コンテンツにジャンプ

Getting Started

GitHub
ターミナルウィンドウ
bun add @capgo/capacitor-install-referrer
bunx cap sync
import { InstallReferrer } from '@capgo/capacitor-install-referrer';
const result = await InstallReferrer.getReferrer();
if (result.platform === 'android') {
console.log('Install referrer:', result.referrer);
console.log('Click timestamp:', result.clickTimestampSeconds);
console.log('Install timestamp:', result.installBeginTimestampSeconds);
}
if (result.platform === 'ios') {
console.log('AdServices token:', result.attributionToken);
}

native codeでAppleのAttributionエンドポイントを呼び出すには fetchAppleAttribution.

const result = await InstallReferrer.getReferrer({
fetchAppleAttribution: true,
appleAttributionRetryCount: 3,
appleAttributionRetryDelayMs: 5000,
});
// result.appleAttribution is the parsed Apple attribution response.
// See the iOS attribution page for the Apple-provided payload fields.
console.log(result.appleAttribution);

Apple は有効なトークンに対してアトリビューションデータが準備中の場合に戻すことができます。 404 再試行オプションは、ネイティブ プラグインが拒否する前に何回再試行するかを制御します。 詳細は iOS アトリビューション

を参照してください。

互換性のあるエイリアス

GetReferrer() セクションのタイトルは “互換性のあるエイリアス” です。 cap-play-install-referrer.

const result = await InstallReferrer.GetReferrer();

New code should use getReferrer().

Getting Started から続けてください。セクションのタイトルは “Getting Started から続けてください” です。 Getting Started native プラグインの作業を計画するには、を接続する必要があります。 @capgo/capacitor-install-referrerを使用します。 @capgo/capacitor-install-referrerのnative機能のために Capgo プラグイン ディレクトリ Capgo プラグイン ディレクトリの製品ワークフローについて Capacitor プラグイン ( Capgo によって提供 ) Capacitor プラグイン ( Capgo によって提供 ) の実装詳細について プラグインの追加または更新 プラグインの追加または更新の実装詳細について Ionic Enterprise プラグインの代替 Ionic Enterprise プラグインの代替の製品ワークフローについて