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.
インストール
「インストール」のセクションCapgoの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.__CAPGO_KEEP_0__の手動セットアップを選択する場合は、以下のコマンドを実行してプラグインをインストールし、下記のプラットフォーム固有の説明を参照してください:
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({} as CrashOptions);setCustomKey
「setCustomKey」を設定するfatalな報告と非fatalな報告の両方に関連付けられたカスタムキーと値を設定します。
AndroidおよびiOSのみ
import { FirebaseCrashlytics } from '@capgo/capacitor-firebase-crashlytics';
await FirebaseCrashlytics.setCustomKey({} as SetCustomKeyOptions);setUserId
「setUserId」を設定するfatalな報告と非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
カスタムキーを設定するオプションのセクション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
「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 によって生成されたサブセットのスタックトレース。
export interface StackFrame { lineNumber?: number; fileName?: string; functionName?: string;}真実の源
「真実の源」セクションこのページはプラグインの「 src/definitions.tspublic API がアップストリームで変更された場合に再度同步を実行してください。
Getting Started から続けて
「Getting Started から続けて」セクションCapgo を使用している場合、 Getting Started to plan dashboard and API operations, connect it with API Overview API の実装詳細についての概要 概要 __CAPGO_KEEP_0__ のキー API キーの実装詳細について for the implementation detail in API Keys, __CAPGO_KEEP_0__ の実装詳細についてのデバイス バンドル __CAPGO_KEEP_0__ の実装詳細についてのバンドル ページを編集