__CAPGO_KEEP_2__

はじめに

GitHub

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.

Manual Setupを使用する場合は、以下のコマンドを実行して、下記のプラットフォーム固有の指示に従ってください。

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

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 属性

を参照してください。

互換性のあるエイリアス

GetReferrer() Capacitorから移行しているアプリ向けに利用可能です。 cap-play-install-referrer.

const result = await InstallReferrer.GetReferrer();

新しいcodeを使用する場合は getReferrer().

Capacitorから移行している場合 Getting Startedを使用してネイティブプラグインの作業を計画する場合、Capacitorから移行しているプラグインを接続してください。 Capacitorから移行しているプラグインを使用する場合、@__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-install-referrer Capacitorから移行しているプラグインを使用する場合、@capgo/capacitor-install-referrerのネイティブ機能 for the native capability in Using @capgo/capacitor-install-referrer, Capacitorから移行しているプラグインを使用する場合、Capgo プラグインディレクトリの製品ワークフロー for the product workflow in Capgo Plugin Directory, Capacitor Plugins by Capgo for the implementation detail in Capacitor Plugins by Capgo, プラグインの追加または更新 プラグインの実装詳細については、プラグインの追加または更新を参照してください。 Ionic Enterprise プラグインの代替 Ionic Enterprise プラグインの代替の製品ワークフローについては、Ionic Enterprise プラグインの代替を参照してください。