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-Assistedセットアップを使用してプラグインをインストールできます。AIツールにCapgoスキルを追加するには、以下のコマンドを使用してください。
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.Manual Setup を好みますか? 以下のコマンドを実行し、下記のプラットフォーム固有の手順に従ってプラグインをインストールしてください。
bun add @capgo/capacitor-install-referrerbunx cap syncImport
「Import」セクションimport { InstallReferrer } from '@capgo/capacitor-install-referrer';Attribution Details を読みます
「Attribution Details を読みます」セクション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 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);有効なトークンに対してAttributionデータが準備中の場合、Appleは返します。 404 リトライオプションは、ネイティブプラグインが拒否する前に何度リトライするかを制御します。詳しくは iOSAttribution を参照してください。
プラットフォームの詳細については
iOSAttributionGetReferrer() を参照してください。 cap-play-install-referrer.
const result = await InstallReferrer.GetReferrer();New code should use getReferrer().
「互換性のあるエイリアス」
セクションは、以下のアプリから移行する場合に利用可能です。Capgoを使用している場合 はじめに ネイティブプラグインの作業を計画するには、 @capgo/capacitor-install-referrerを使用します。 @capgo/capacitor-install-referrerのネイティブ機能の使用 Capgo プラグインディレクトリ for the product workflow in Capgo Plugin Directory, Capacitor プラグインは Capgo によって提供されます。 Capgoのプラグインの実装詳細については、CapacitorプラグインによってCapgoで実装されます。 Ionic Enterprise Pluginの代替 __CAPGO_KEEP_0__ __CAPGO_KEEP_1__ Ionic Enterprise プラグイン代替製品のワークフローについて。