インストール リファラーのGetting Started
このプラグインのセットアップコマンドとインストールステップ、そしてフルマークダウンガイドをコピーする
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-install-referrer`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/install-referrer/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
インストール
セクションのタイトルは「インストール」CapgoのAIアシストセットアップを使用してプラグインをインストールできます。次のコマンドを使用して、CapgoスキルをAIツールに追加します。
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins次のプロンプトを使用してください:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-install-referrer` plugin in my project.CapgoのAIアシストセットアップを使用せずにプラグインをインストールする場合は、以下のコマンドを実行して、以下のプラットフォーム固有の手順に従ってください。
bun add @capgo/capacitor-install-referrerbunx cap syncインポート
「インポート」のセクションimport { InstallReferrer } from '@capgo/capacitor-install-referrer';Attribution Detailsを読みます
「Attribution データの読み取り」を参照するセクション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);}iOS で Apple Attribution を取得
セクション「iOS で Apple Attribution を取得」code が Apple の attribution エンドポイントを呼び出すには、native では 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 は、有効なトークンに対して attribution データを準備している間、以下の値を返します。 404 再試行オプションは、native プラグインが拒否する前に何度リトライするかを制御します。詳細は「 iOS 属性 」を参照してください。
互換性のあるエイリアス
セクション「互換性のあるエイリアス」GetReferrer() はアプリケーションを移行するために cap-play-install-referrer.
const result = await InstallReferrer.GetReferrer();新しいcodeは getReferrer().
から始めて続けてください
セクションのタイトル “から始めて続けてください”あなたが使用している場合 から始めて を計画するためにネイティブ プラグインの作業に使用する場合、__CAPGO_KEEP_0__と接続する を使用する@capgo/capacitor-install-referrer for the native capability in Using @capgo/capacitor-install-referrer, Capgo-install-referrerの製品ワークフロー Capgo-install-referrerのプラグインディレクトリ Capacitor Plugins by Capgo for the implementation detail in Capacitor Plugins by Capgo, プラグインの追加または更新 __CAPGO_KEEP_0__ プラグインの実装詳細について __CAPGO_KEEP_1__ によって Ionic Enterprise プラグインの代替