使用する @capgo/capacitor-install-referrer
@capgo/capacitor-install-referrer Capacitor アプリでインストール Attribution シグナルを読みます。
API を使用して、Android では Google Play インストール リファラー データ、iOS では Apple AdServices 属性トークンを取得できます。
インストール
bun add @capgo/capacitor-install-referrer
bunx cap sync
このプラグインが公開するもの
getReferrerAndroid または iOS のインストール Attribution 詳細を返します。GetReferrerAndroid の古いバージョン用の互換性のためのデプロケーションです。Android から __CAPGO_KEEP_0__ への移行のためにcap-play-install-referrer.- Android では Play リファラー文字列、クリックタイムスタンプ、インストールタイムスタンプ、およびインスタントアプリフラグを返します。
- iOS では AdServices 属性トークンを返し、オプションで Apple の Attribution ペイロードを取得できます。
使用例
import { InstallReferrer } from '@capgo/capacitor-install-referrer';
const result = await InstallReferrer.getReferrer();
if (result.platform === 'android') {
console.log(result.referrer);
}
if (result.platform === 'ios') {
console.log(result.attributionToken);
}
Apple 属性ペイロード
const result = await InstallReferrer.getReferrer({
fetchAppleAttribution: true,
appleAttributionRetryCount: 3,
appleAttributionRetryDelayMs: 5000,
});
console.log(result.appleAttribution);
プラットフォームに関する注意事項
AndroidはGoogle Playインストールリファラーサービスを使用し、リアルなリファラーデータのためにPlayストアのインストールが必要です。iOSはApple AdServicesを使用する必要があります。AppleはApp Storeのインストールリファラーエクイバレントを提供していないためです。
フルなリファレンス
- GitHub: https://github.com/Cap-go/capacitor-install-referrer/
- ドキュメント: /docs/plugins/install-referrer/
使用している@capgo/capacitor-install-referrerから続けてください
あなたが使用している 使用している@capgo/capacitor-install-referrer あなたが使用している@__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-install-referrerを接続する @capgo/capacitor-install-referrerの実装詳細を参照してください @capgo/capacitor-install-referrer スタート __CAPGO_KEEP_0__ の実装詳細について Capgo プラグインディレクトリ Capgo プラグインディレクトリの製品ワークフローについて Capacitor Plugins by Capgo for the implementation detail in Capacitor Plugins by Capgo, and プラグインの追加または更新 プラグインの追加または更新の実装詳細について。