メインコンテンツにジャンプ
@capgo/capacitor-firebase-performance 分析 オープンソース

Firebase パフォーマンス Capacitor プラグイン

Capacitor プラグイン for Firebase パフォーマンス モニタリング

インストール

bun add @capgo/capacitor-firebase-performance bunx cap sync
npm、pnpm または yarn
  • npm install @capgo/capacitor-firebase-performance
  • pnpm add @capgo/capacitor-firebase-performance
  • yarn add @capgo/capacitor-firebase-performance

ガイド

CapacitorでFirebase Performanceを使用する方法

@capgo/capacitor-firebase-performanceを使用する

CapacitorのFirebase Performanceモニタリング用プラグイン

インストール

bun add @capgo/capacitor-firebase-performance
bunx cap sync

bunx cap sync プラグインのネイティブcodeをプロジェクトにコピーします。プラグインのアップグレード後は、再度実行してください。

インポート

import { FirebasePerformance } from '@capgo/capacitor-firebase-performance';

APIの概要

方法 説明
startTrace トレースを開始します。
stopTrace トレースを停止します。
incrementMetric 選択したトレースの指定されたメトリックに与えられた値を含めて、原子的にインクリメントします。 incrementBy value.
setEnabled パフォーマンスモニタリングが有効か無効かを決定します。
isEnabled トレースのカスタム属性を指定された値に設定します。
putAttribute トレースのカスタム属性の値を取得します。
getAttribute メソッド
getAttributes すべてのカスタム属性を取得します。
removeAttribute 指定された名前のカスタム属性を削除します。
putMetric カスタムメトリックの値を設定します。
getMetric 指定された名前のカスタムメトリックの値を取得します。
record 指定された名前とオプションでトレースを記録します。

例

startTrace()

ページ/エリア: バグバウティープログラムページ。役割: セクションまたはページヘッダー。見られる場所: bug-bounty.astroページ。メッセージキー `bug_bounty_supabase_examples_title` (バグバウティー スーパーバース エクサンプル タイトル)。

import { FirebasePerformance } from '@capgo/capacitor-firebase-performance';

await FirebasePerformance.startTrace({ traceName: 'trace' });

stopTrace()

トレースを開始します。

import { FirebasePerformance } from '@capgo/capacitor-firebase-performance';

await FirebasePerformance.stopTrace({ traceName: 'trace' });

incrementMetric()

トレースを停止します。 incrementBy value.

import { FirebasePerformance } from '@capgo/capacitor-firebase-performance';

await FirebasePerformance.incrementMetric({
  traceName: 'trace',
  metricName: 'metric',
});

setEnabled()

パフォーマンスモニタリングを有効または無効にします。次のアプリ起動時に適用されます。

import { FirebasePerformance } from '@capgo/capacitor-firebase-performance';

await FirebasePerformance.setEnabled({ enabled: true });

isEnabled()

パフォーマンスモニタリングが有効か無効かを判断します。

import { FirebasePerformance } from '@capgo/capacitor-firebase-performance';

const result = await FirebasePerformance.isEnabled();
console.log(result);

putAttribute()

指定された値にトレースのカスタム属性を設定します。

import { FirebasePerformance } from '@capgo/capacitor-firebase-performance';

await FirebasePerformance.putAttribute({
  traceName: 'trace',
  attribute: "experiment",
  value: "A",
});

上の表には、12の基本メソッドがリストされています。リスナーとバージョンヘルパー、各メソッドのフルコントラクトは、以下のリポジトリでドキュメント化されています。 GitHub リポジトリ.

フルリファレンス

@capgo/capacitor-firebase-performance

Capgo を使用して Firebase Performance を使用している場合 @Capgo/capacitor/capgo-firebase-performance Capgo プラグイン ディレクトリ Capgo プラグインディレクトリ for the product workflow in Capgo Plugin Directory, Capacitor Capgo Capgoの実装詳細については、Capacitor プラグインによって Capgo で管理されます。 プラグインの追加または更新 プラグインの追加または更新の実装詳細について Ionic Enterpriseプラグインの代替 製品ワークフローについて、Ionic Enterpriseプラグインの代替、 Capgo 本機ビルド Capgoの製品ワークフローにおけるCapgoネイティブビルドのために。

FAQ

Firebase Performance プラグインのFAQ

Firebase Performance プラグインを Capacitor アプリにインストールするにはどうすればいいですか?

Run "bun add @capgo/capacitor-firebase-performance" (または "npm install @capgo/capacitor-firebase-performance"), そして "bunx cap sync" を実行して iOS と Android プロジェクトがネイティブ code を取得するようにします。 それから、@capgo/capacitor-firebase-performance をアプリの code でインポートしてください。

@capgo/capacitor-firebase-performance は React、Vue、Angular とどのように動作しますか?

はい。 Firebase Performance は Capacitor パッケージなので、Ionic、React、Vue、Angular、Svelte、または単純な JavaScript など、Capacitor 内で実行される任意の Web フレームワークと互換性があります。

Which Capacitor version does @capgo/capacitor-firebase-performance support?

Capgo plugins follow Capacitor's major version: use the plugin major version that matches your Capacitor major version (for example plugin v8 with Capacitor 8). The compatibility table in the GitHub README lists the maintained versions.

@capgo/capacitor-firebase-performanceは無料でオープンソースですか?

Yes. The source code is public on GitHub at https://github.com/Cap-go/capacitor-firebase/tree/main/packages/performance and the package is free to install from npm. Bug reports and pull requests are welcome.

@codeを使用するFirebase PerformanceをアップデートすることはApp Storeのレビューなしでできますか?

Installing or upgrading the plugin changes native code, so it needs a new store build. After that, JavaScript, HTML and CSS changes that call the plugin can ship instantly with Capgo live updates.

Firebase パフォーマンスの変更をアプリレビューの待たずに配信する

プラグインがストアビルドに追加されたら、Capgo ライブアップデートは、ユーザーにJavaScript、HTML、CSSの変更を数分でプッシュします。

Capgo で始めましょう