はじめから始める
このプラグインのセットアッププロンプトをコピーします。インストール手順とフルマークダウンガイドが含まれます。
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.
インストール
「インストール」のセクションCapgoのAI-Assistedセットアップを使用してプラグインをインストールできます。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
「crash」のセクション実装をテストするためにクラッシュを強制します。
AndroidおよびiOSのみで利用可能です。
import { FirebaseCrashlytics } from '@capgo/capacitor-firebase-crashlytics';
await FirebaseCrashlytics.crash({} as CrashOptions);setCustomKey
「setCustomKey」のセクションfatalおよびnon-fatalレポートに続くカスタムキーと値を設定します。
AndroidおよびiOSのみで利用可能です。
import { FirebaseCrashlytics } from '@capgo/capacitor-firebase-crashlytics';
await FirebaseCrashlytics.setCustomKey({} as SetCustomKeyOptions);setUserId
「setUserId」のセクションfatalおよびnon-fatalレポートに続くユーザーIDを設定します。
AndroidおよびiOSのみで利用可能です。
import { FirebaseCrashlytics } from '@capgo/capacitor-firebase-crashlytics';
await FirebaseCrashlytics.setUserId({} as SetUserIdOptions);log
「log」のセクションクラッシュデータに送信されるカスタムログメッセージを追加します。
AndroidおよびiOSのみで利用可能です。
import { FirebaseCrashlytics } from '@capgo/capacitor-firebase-crashlytics';
await FirebaseCrashlytics.log({} as LogOptions);setEnabled
setEnabledのセクション自動データ収集を有効/無効にします。 アプリの次の実行時まで値は適用されません。
AndroidおよびiOSのみで利用可能です。
import { FirebaseCrashlytics } from '@capgo/capacitor-firebase-crashlytics';
await FirebaseCrashlytics.setEnabled({} as SetEnabledOptions);isEnabled
isEnabledのセクション自動データ収集が有効かどうかを返します。
iOSのみで利用可能です。
import { FirebaseCrashlytics } from '@capgo/capacitor-firebase-crashlytics';
await FirebaseCrashlytics.isEnabled();didCrashOnPreviousExecution
didCrashOnPreviousExecutionのセクション前回の実行時、エラーが発生したかどうかを返します。
AndroidおよびiOSのみで利用可能です。
import { FirebaseCrashlytics } from '@capgo/capacitor-firebase-crashlytics';
await FirebaseCrashlytics.didCrashOnPreviousExecution();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({} as RecordExceptionOptions);型参照
「型参照」のセクションCrashOptions
「CrashOptions」のセクションexport interface CrashOptions { /** * @since 0.1.0 */ message: string;}SetCustomKeyOptions
「SetCustomKeyOptions」のセクションexport type SetCustomKeyOptions = CustomKeyAndValue;SetUserIdOptions
「SetUserIdOptions」のセクションexport interface SetUserIdOptions { /** * @since 0.1.0 */ userId: string;}LogOptions
「LogOptions」のセクションexport interface LogOptions { /** * @since 0.1.0 */ message: string;}SetEnabledOptions
「SetEnabledOptions」のセクションexport interface SetEnabledOptions { /** * @since 0.1.0 */ enabled: boolean;}IsEnabledResult
「IsEnabledResult」のセクションexport interface IsEnabledResult { /** * @since 0.1.0 */ enabled: boolean;}DidCrashOnPreviousExecutionResult
「DidCrashOnPreviousExecutionResult」のセクションexport interface DidCrashOnPreviousExecutionResult { /** * @since 0.1.0 */ crashed: boolean;}RecordExceptionOptions
「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
「GetPluginVersionResult」のセクションexport interface GetPluginVersionResult { /** * The semantic version of this plugin. * * @since 8.0.2 */ version: string;}CustomKeyAndValue
「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
「StackFrame」のセクションstacktrace.jsによって生成されたStacktraceのサブセット。
export interface StackFrame { lineNumber?: number; fileName?: string; functionName?: string;}真実の源
「真実の源」のセクションこのページはプラグインの src/definitions.tspublic APIがアップストリームで変更されたときに再度Syncを実行してください。
Getting Startedから続けてください
「Getting Startedから続けてください」のセクションCapacitorを使用している場合 Getting Started Capgoの計画ダッシュボードとAPIの操作を計画するには、 APIの概要 APIの概要の実装詳細については 導入 導入の実装詳細については APIのキー APIのキーに関する実装詳細については デバイス デバイスの実装詳細については、 バンドル バンドルに関する実装詳細については。