Guide
Capacitorを使用する方法
@capgo/capacitor-install-referrerを使用
@capgo/capacitor-install-referrer Capacitorアプリでインストール Attribution シグナルを読み取ります。
AndroidとApple AdServices Attribution トークンをiOSで使用する必要がある場合、Google Playインストールリファラー データを1つのAPIで取得できます。
インストール
bun add @capgo/capacitor-install-referrer
bunx cap sync
このプラグインが公開するもの
getReferrerAndroidまたはiOSのインストール Attribution の詳細を返します。GetReferrerAndroid用の古い互換性のための移行用のデプロケーション コンパチビリティ アライアスです。cap-play-install-referrer.- AndroidはPlayリファラー文字列、クリックタイムスタンプ、インストールタイムスタンプ、およびインスタントアプリフラグを返します。
- iOSはAdServicesのAttribution Tokenを返し、AppleのAttribution Payloadをオプションで取得することができます。
使用例
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 Attribution Payload
const result = await InstallReferrer.getReferrer({
fetchAppleAttribution: true,
appleAttributionRetryCount: 3,
appleAttributionRetryDelayMs: 5000,
});
console.log(result.appleAttribution);
プラットフォームに関する注意
AndroidはGoogle Play Install Referrerサービスを使用し、リアルなリファラー データを取得するためにPlay Storeのインストールが必要です。iOSはApple AdServicesを使用する必要があります。AppleはApp Storeのインストールのための一般的なリファラーの代替品を提供していないためです。
フル リファレンス
- GitHub: https://github.com/Cap-go/capacitor-install-referrer/
- ドキュメント: /docs/plugins/install-referrer/
capgoの@capacitor-install-referrerを使用している場合
__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-install-referrerを使用している場合 Using @capgo/capacitor-install-referrer ネイティブ プラグインの作業を計画するには、接続してください。 @capgo/capacitor-install-referrer Capacitor @capgo/capacitor-install-referrer の実装詳細については Getting Started Getting Started の実装詳細については Capgo プラグイン ディレクトリ Capgo プラグイン ディレクトリの製品ワークフローについては Capacitor Capgo Capacitor Capacitor Plugins by Capgo の実装詳細については、 プラグインの追加または更新 Adding or Updating Plugins の実装詳細については