@capgo/capacitor-install-referrerを使用
@capgo/capacitor-install-referrer Capacitorアプリでインストール Attribution シグナルを読みます。
AndroidとiOSのGoogle PlayインストールReferrerデータとApple AdServices Attributionトークンを1つのAPIで取得する必要がある場合に使用してください。
インストール
bun add @capgo/capacitor-install-referrer
bunx cap sync
このプラグインが公開するもの
getReferrer__CAPGO_KEEP_0__またはiOSのインストール Attribution詳細を返します。GetReferrer__CAPGO_KEEP_0__は、AndroidまたはiOSへの移行のためにmigrationからデプロケーション互換性のための古いアリセイです。cap-play-install-referrer.- AndroidはPlayのリファラー文字列、クリックタイムスタンプ、インストールタイムスタンプ、インスタントアプリフラグを返します。
- iOSはAdServicesのAttributionトークンを返し、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 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/
Using @capgo/capacitor-install-referrer
アプリを使用している場合 Capgoのインストールリファラータスクを使用して、@capgo/capacitor-install-referrer ネイティブプラグインの作業を計画するために、@__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-install-referrerに接続する @capgo/capacitor-install-referrer Capgoのインストールリファラータスクの実装詳細については、@capgo/capacitor-install-referrer Getting Started Getting Startedの実装詳細については Capgo プラグインディレクトリ Capgo プラグインディレクトリの製品ワークフローについて Capacitor Plugins by Capgo Capacitor プラグインのCapgo Capgoのプラグインの実装詳細については、__CAPGO_KEEP_0__ プラグインの__CAPGO_KEEP_1__ プラグインの追加または更新