Using @capgo/capacitor-install-referrer
@capgo/capacitor-install-referrer Capacitor アプリでインストール Attribution シグナルを読み取ります。
Google Play インストール Referrer データを Android と Apple AdServices 属性トークンを iOS から 1 つの API で取得する必要がある場合に使用してください。
インストール
bun add @capgo/capacitor-install-referrer
bunx cap sync
このプラグインが公開するもの
getReferrerAndroid または iOS のインストール Attribution 詳細を返します。GetReferrerAndroid の場合、Play referrer string、クリックタイムスタンプ、インストールタイムスタンプ、およびインスタントアプリフラグが返されます。cap-play-install-referrer.- iOS の場合、AdServices 属性トークンが返され、オプションで Apple の Attribution ペイロードを取得できます。
- is a deprecated compatibility alias for migration from
例の使用方法
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/capacitor-install-referrerを使用している場合 __CAPGO_KEEP_0__/__CAPGO_KEEP_1__-install-referrerを使用して @capgo/capacitor-install-referrer @capgo/capacitor-install-referrer はじめに @__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-install-referrer Capgo プラグイン ディレクトリ @Capgo プラグイン ディレクトリ Capacitor Plugins by Capgo for the implementation detail in Capacitor Plugins by Capgo, and プラグインの追加または更新 @__CAPGO_KEEP_0__ プラグインの追加または更新