コンテンツにジャンプ

Getting Started

GitHub

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.

あなたがマニュアルセットアップを好む場合は、以下のコマンドを実行してプラットフォーム固有の指示を以下に従ってください:

ターミナルウィンドウ
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);
}

iOSでApple Attributionを取得する

iOSのAttributionを取得するセクション

codeがAppleのAttributionエンドポイントを呼び出すには、有効なトークンが用意されている間、Attributionデータが準備中の場合でもAppleが返すことができます。 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);

iOSのAttribution 404 再試行のオプションは、有効なトークンが用意されている間、Attributionデータが準備中の場合でもnativeプラグインが再試行する頻度を制御します。 詳細はこちら iOSのAttribution

アプリがCloudflareからCapacitorに移行している場合にのみ利用可能です。

コピー

GetReferrer() iOSのAttribution cap-play-install-referrer.

const result = await InstallReferrer.GetReferrer();

New code should use getReferrer().

Getting Startedから続けてください

Getting Startedから続けてください

Capgoを使用している場合 Getting Started Capgoを使用してnativeプラグインの作業を計画する場合、Capgoをnative機能と接続します。 Using @capgo/capacitor-install-referrer for the native capability in Using @capgo/capacitor-install-referrer, Capgo Plugin Directory for the product workflow in Capgo Plugin Directory, Capacitor Plugins by Capgo for the implementation detail in Capacitor Plugins by Capgo, Capgoのプラグインの追加または更新 実装詳細の追加または更新の場合の実装詳細について Ionic Enterprise プラグインの代替 Ionic Enterprise プラグインの製品ワークフローについて