はじめから
インストールステップとこのプラグインのフルマークダウンガイドを含む設定プロンプトをコピーする
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-firebase-crashlytics`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/firebase-crashlytics/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
インストール
「インストール」のセクションAI-Assisted Setupを使用してプラグインをインストールできます。AIツールにCapgoスキルを追加するには、以下のコマンドを使用してください。
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins次のプロンプトを使用してください:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-firebase-crashlytics` plugin in my project.Manual Setupを使用する場合は、以下のコマンドを実行して、下記のプラットフォーム固有の手順に従ってください。
bun add @capgo/capacitor-firebase-crashlyticsbunx cap syncImport
「Import」のセクションimport { FirebaseCrashlytics } from '@capgo/capacitor-firebase-crashlytics';API オーバービュー
「API オーバービュー」のセクションcrash
「クラッシュ」のセクションクラッシュを強制して実装をテストします。
AndroidとiOSのみ対応
import { FirebaseCrashlytics } from '@capgo/capacitor-firebase-crashlytics';
await FirebaseCrashlytics.crash({ message: 'Hello from Capacitor' });setCustomKey
セクション “setCustomKey”fatalおよびnon-fatalレポートに続くカスタムキーと値を設定します。
AndroidおよびiOSのみ
import { FirebaseCrashlytics } from '@capgo/capacitor-firebase-crashlytics';
await FirebaseCrashlytics.setCustomKey({ key: 'key-123', value: 'value', type: 'string',});setUserId
セクション “setUserId”fatalおよびnon-fatalレポートに続くユーザーID(識別子)を設定します。
AndroidおよびiOSのみ
import { FirebaseCrashlytics } from '@capgo/capacitor-firebase-crashlytics';
await FirebaseCrashlytics.setUserId({ userId: 'user-id-123' });log
セクション “log”クラッシュデータに送信されるカスタムログメッセージを追加して、クラッシュの原因となるイベントの流れをより深く理解できます。
AndroidおよびiOSのみ
import { FirebaseCrashlytics } from '@capgo/capacitor-firebase-crashlytics';
await FirebaseCrashlytics.log({ message: 'Hello from Capacitor' });setEnabled
setEnabledのセクション自動データ収集を有効/無効にします。値は、次のアプリの実行まで適用されません。
AndroidとiOSのみ
import { FirebaseCrashlytics } from '@capgo/capacitor-firebase-crashlytics';
await FirebaseCrashlytics.setEnabled({ enabled: true });isEnabled
setEnabledのセクション自動データ収集が有効かどうかを返します。
iOSのみ
import { FirebaseCrashlytics } from '@capgo/capacitor-firebase-crashlytics';
const result = await FirebaseCrashlytics.isEnabled();console.log(result);didCrashOnPreviousExecution
didCrashOnPreviousExecutionのセクション前回の実行でアプリがクラッシュしたかどうかを返します。
AndroidとiOSのみ
import { FirebaseCrashlytics } from '@capgo/capacitor-firebase-crashlytics';
const result = await FirebaseCrashlytics.didCrashOnPreviousExecution();console.log(result);sendUnsentReports
セクション「sendUnsentReports」起動時、未送信のレポートをCrashlyticsにアップロードします。
自動データ収集が有効の場合、起動時にCrashlyticsがレポートを自動的にアップロードします。
AndroidおよびiOSのみで利用可能です。
import { FirebaseCrashlytics } from '@capgo/capacitor-firebase-crashlytics';
await FirebaseCrashlytics.sendUnsentReports();deleteUnsentReports
セクション「deleteUnsentReports」デバイス上の未送信のレポートを削除します。
AndroidおよびiOSのみで利用可能です。
import { FirebaseCrashlytics } from '@capgo/capacitor-firebase-crashlytics';
await FirebaseCrashlytics.deleteUnsentReports();recordException
セクション「recordException」非致死的なレポートをCrashlyticsに送信します。
AndroidおよびiOSのみで利用可能です。
import { FirebaseCrashlytics } from '@capgo/capacitor-firebase-crashlytics';
await FirebaseCrashlytics.recordException({ message: 'Hello from Capacitor' });型参照
「型参照」CrashOptions
「クラッシュオプション」export interface CrashOptions { /** * @since 0.1.0 */ message: string;}SetCustomKeyOptions
「カスタムキー設定オプション」export type SetCustomKeyOptions = CustomKeyAndValue;SetUserIdOptions
「ユーザーID設定オプション」export interface SetUserIdOptions { /** * @since 0.1.0 */ userId: string;}LogOptions
「ログオプション」export interface LogOptions { /** * @since 0.1.0 */ message: string;}SetEnabledOptions
セクション「有効化オプションの設定」export interface SetEnabledOptions { /** * @since 0.1.0 */ enabled: boolean;}IsEnabledResult
セクション「有効化結果」export interface IsEnabledResult { /** * @since 0.1.0 */ enabled: boolean;}DidCrashOnPreviousExecutionResult
セクション「前の実行でクラッシュした結果」export interface DidCrashOnPreviousExecutionResult { /** * @since 0.1.0 */ crashed: boolean;}RecordExceptionOptions
セクション「エラーのレコードオプション」export interface RecordExceptionOptions { /** * The message to record as a non-fatal exception. * * @since 0.1.0 */ message: string; /** * Error code within a specific error domain. * * **Attention:** This option is ignored on iOS if `stacktrace` is provided. * * Only available for iOS. * * @since 0.1.0 */ code?: number; /** * A string containing the error domain. * * **Attention:** This option is ignored on iOS if `stacktrace` is provided. * * Only available for iOS. * * @since 0.1.0 */ domain?: string; /** * An array of keys and the values to associate with the non fatal exception, * in addition to the app level custom keys. * * **Attention:** This option is ignored on iOS if `stacktrace` is provided. * * @since 7.1.0 */ keysAndValues?: CustomKeyAndValue[]; /** * A stacktrace generated by stacktrace.js. * * @since 1.1.0 */ stacktrace?: StackFrame[];}GetPluginVersionResult
セクション「プラグインバージョン取得結果」export interface GetPluginVersionResult { /** * The semantic version of this plugin. * * @since 8.0.2 */ version: string;}CustomKeyAndValue
セクション「カスタムキーと値」export interface CustomKeyAndValue { /** * @since 7.1.0 */ key: string; /** * @since 7.1.0 */ value: string | number | boolean; /** * @since 7.1.0 */ type: 'string' | 'long' | 'double' | 'boolean' | 'int' | 'float';}StackFrame
StackFramestacktrace.js によって生成されたStacktraceのサブセットです。
export interface StackFrame { lineNumber?: number; fileName?: string; functionName?: string;}真実の源
真実の源このページはプラグインの src/definitions.tsパブリック API がアップストリームで変更されたときに再度同期してください。
Getting Started から続けてください
Getting Started から続けてくださいGetting Started を使用してダッシュボードと __CAPGO_KEEP_0__ の作業を計画している場合、 スタートガイド Capgoを使用して計画ダッシュボードとAPIの運用を実施するには、接続する API まとめ API の概要 Introduction 導入 API キー API のキー デバイス 実装詳細はデバイスのページで バンドル 実装詳細はバンドルページで