Install @__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-install-referrer

Getting Started

GitHub

インストール

インストール

インストールするには、AI-Assisted Setupを使用できます。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-referrer
bunx cap sync

インポート

インポート
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);
}

もし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 有効なトークンが用意されるまでのAttributionデータの準備中です。リトライオプションは、ネイティブプラグインが失敗する前に何度リトライするかを制御します。詳しくは iOSのAttribution を参照してください。

GetReferrer() CapgoのネイティブアプリがCapacitorから移行するアプリ向けに cap-play-install-referrer.

const result = await InstallReferrer.GetReferrer();

新しいcodeは getReferrer().

続けて「Getting Started」から

「続けて「Getting Started」から」

「Getting Started」を使用している場合 「Getting Started」 「Getting Started」を使用してネイティブプラグインの作業を計画する場合、__CAPGO_KEEP_0__を 「@capgo/capacitor-install-referrer」を使用 「@capgo/capacitor-install-referrer」を使用して「@capgo/capacitor-install-referrer」 「Capgo プラグインディレクトリ」 「Capgo プラグインディレクトリ」 Capacitor プラグインは Capgo によって提供されます。 Capacitorの実装詳細については、Capgoプラグインで プラグインの追加または更新 __CAPGO_KEEP_0__の実装詳細については、プラグインの追加または更新、そして イオニック エンタープライズ プラグインの代替 __CAPGO_KEEP_0__の製品ワークフローについては、イオニック エンタープライズ プラグインの代替