Getting Started
インストールステップとこのプラグインのフルマークダウンガイドを含むセットアップ用質問をコピーしてください。
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.
インストール
Installbun add @capgo/capacitor-firebase-crashlyticsbunx cap syncインポート
Importimport { FirebaseCrashlytics } from '@capgo/capacitor-firebase-crashlytics';API の概要
API の概要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
クラッシュオプション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
型別「ログオプション」export interface LogOptions { /** * @since 0.1.0 */ message: string;}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 生成されたサブセット
export interface StackFrame { lineNumber?: number; fileName?: string; functionName?: string;}真実の源
真実の源プラグインの生成されたページ src/definitions.tspublic API がアップストリームで変更された場合に再度 Sync を実行してください。
Getting Started から続けて
Getting Started から続けてあなたが使用している場合 Getting Started ダッシュボードと API の作業を計画するには、を接続してください。 API の概要 実装詳細については API の概要を参照してください。 概要 実装詳細については Introduction を参照してください。 API のキーコンセプト 実装詳細については API のキーコンセプトを参照してください。 デバイス 実装詳細については Devices を参照してください。 バンドル 実装詳細については Bundles を参照してください。