コンテンツにスキップ

Getting Started

GitHub

Capgoの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-appsflyer` plugin in my project.

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

ターミナルウィンドウ
bun add @capgo/capacitor-appsflyer
bunx cap sync
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
import type {
AFAdRevenueData,
AFAndroidInAppPurchase,
AFAnonymizeUser,
AFAppendToDeepLink,
AFConsentData,
AFConsentOptions,
AFCuid,
AFCurrency,
AFData,
AFDisable,
AFEmails,
AFEnableTCFDataCollection,
AFEvent,
AFFbDAL,
AFFilters,
AFHost,
AFInit,
AFIosInAppPurchase,
AFLanguage,
AFLatLng,
AFLinkGenerator,
AFLogInvite,
AFOnelinkDomain,
AFOnelinkID,
AFPartnerData,
AFPath,
AFPhone,
AFPromotion,
AFPurchaseDetailsV2,
AFPushPayload,
AFUninstall,
AFUrls,
} from '@capgo/capacitor-appsflyer';

このメソッドを使用して、AppsFlyer SDKを初期化して開始します。この API は、アプリが起動したときにすぐに呼び出してください。

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.initSDK({} as AFInit);

AppsFlyer SDK を手動起動モードで開始するには、このメソッドを使用してください。

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.startSDK();

アプリ内イベントをログします。

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.logEvent({} as AFEvent);

自分の顧客IDを設定すると、AppsFlyerの独自IDと他のデバイスのIDとをクロス参照できます。 このIDは、raw-data レポートとPostback APIで利用できます。

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.setCustomerUserId({} as AFCuid);

アプリ内購入の通貨を設定します。3桁のISO 4217 codeを指定してください。

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.setCurrencyCode({} as AFCurrency);

AndroidのGCM/FCMトークンまたはiOSのAPNsトークンを渡します。 AppsFlyerにアンインストール測定トークンを転送するために使用します。

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.updateServerUninstallToken({} as AFUninstall);

招待の特定に使用されるベースリンクとしてのOneLink IDを設定します。

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.setAppInviteOneLink({} as AFOnelinkID);

AppsFlyerが短リンク内の属性パラメータを解決できるように、ブランド化されたOneLinkドメインを登録します。

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.setOneLinkCustomDomain({} as AFOnelinkDomain);

startSDK()パラメータマップに含める必要があります。 pid Section titled “appendParametersToDeepLinkingURL” is_retargeting=true Section titled “setOneLinkCustomDomain”

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.appendParametersToDeepLinkingURL({} as AFAppendToDeepLink);

AppsFlyer OneLinkが他のUniversal Linkの中に包まれている場合に使用します。 SDKが包まれたURLを解決するので、深いリンクが正しく機能します。

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.setResolveDeepLinkURLs({} as AFUrls);

SDKがプッシュ通知のペイロードから深いリンク値を抽出する方法を設定します。

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.addPushNotificationDeepLinkPath({} as AFPath);

指定されたAppsFlyerパートナーにイベントが伝播するのを止めます。

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.setSharingFilter({} as AFFilters);

すべてのAppsFlyerパートナーにイベントが伝播するのを止めます。setSharingFilterを上書きします。

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.setSharingFilterForAllPartners();

指定されたAppsFlyerパートナーにイベントを伝播させない

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.setSharingFilterForPartners({} as AFFilters);

AppsFlyerに追加のキー値データを送信する

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.setAdditionalData({} as AFData);

AppsFlyerのユニークデバイスIDを取得します (アプリの新しいインストールごとに作成)

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.getAppsFlyerUID();

AppsFlyerの分析からユーザーを匿名化する (ユーザー情報を非表示にする)

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.anonymizeUser({} as AFAnonymizeUser);

APIが呼び出された後、SDKはサーバーとの通信を停止し機能を停止します。 ユーザーによるオプトイン/オプトアウトの実装に役立ちます。

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.stop();

SKAdNetworkからオプトアウト

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.disableSKAdNetwork({} as AFDisable);

SDKによって収集される広告IDの多様な種類を無効化します。これには、Apple Identity for Advertisers (IDFA)、Google Advertising ID (GAID)、OAID、および Amazon Advertising ID (AAID) が含まれます。

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.disableAdvertisingIdentifier({} as AFDisable);

Apple Search AdsのAttributionからオプトアウト

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.disableCollectASA({} as AFDisable);

カスタムホストを設定します。

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.setHost({} as AFHost);

既存のユーザーが友人や連絡先を新しいユーザーとしてアプリに招待できるようにします。

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.generateInviteLink({} as AFLinkGenerator);

APIはサーバーによるアプリ内課金の検証のために使用されます。検証が成功した場合、関連する値を含むaf_purchaseイベントが自動的にログに記録されます。

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.validateAndLogInAppPurchaseAndroid({} as AFAndroidInAppPurchase);

現在の契約のソース定義を参照してください。

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.validateAndLogInAppPurchaseIos({} as AFIosInAppPurchase);

アプリに使用されている AppsFlyer SDK のバージョンを取得します。

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.getSdkVersion();

Facebook Deferred AppLinks の収集を有効にします。Facebook SDK と Facebook アプリがターゲット/クライアント デバイスにインストールされている必要があります。 この API を AppsFlyer SDK を初期化する前に呼び出す必要があります。

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.enableFacebookDeferredApplinks({} as AFFbDAL);

プッシュ通知キャンペーンのデータを測定して取得します。

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.sendPushNotificationData({} as AFPushPayload);

デバイスの言語を設定します。データは Raw Data Reports で表示されます。

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.setCurrentDeviceLanguage({} as AFLanguage);

logCrossPromoteImpression

__CAPGO_KEEP_1__

__CAPGO_KEEP_2__

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.logCrossPromoteImpression({} as AFPromotion);

setUserEmails

__CAPGO_KEEP_3__

__CAPGO_KEEP_4__

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.setUserEmails({} as AFEmails);

logLocation

__CAPGO_KEEP_5__

__CAPGO_KEEP_0__

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.logLocation({} as AFLatLng);

setPhoneNumber

__CAPGO_KEEP_0__

__CAPGO_KEEP_7__

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.setPhoneNumber({} as AFPhone);

パートナー統合の目的でカスタムデータを送信することを許可します。

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.setPartnerData({} as AFPartnerData);

インストール内イベント (af_invite) をログインするために使用します。

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.logInvite({} as AFLogInvite);

ネットワークオペレータ名 (キャリア) と SIM オペレータ名をデバイスから収集することをオプトアウトします。

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.setDisableNetworkData({} as AFDisable);

CMP を使用するユーザー向けに、自動的にconsentデータを収集することをオプトイン/アウトします。 フラグ値はアプリセッション間で保持されます。

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.enableTCFDataCollection({} as AFEnableTCFDataCollection);

setConsentData

setConsentData

ユーザー同意データを手動で設定します。 TCF v2.2に互換性のあるCMPを使用していない場合は、次の方法を使用して、ユーザー同意データを直接SDKに提供します。

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.setConsentData({} as AFConsentData);

logAdRevenue

logAdRevenue

広告収益を特定することで、アプリの所有者はユーザーのLTVとキャンペーンROIを完全に把握できます。 広告収益は、報酬ビデオ、オファー ウォール、インテリセスト、バナーなど、広告を表示することで生成されます。 このメソッドを使用して広告収益を記録できます。

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.logAdRevenue({} as AFAdRevenueData);

setConsentDataV2

setConsentDataV2

ユーザー同意データを手動で設定します。 TCF v2.2に互換性のあるCMPを使用していない場合は、次の方法を使用して、ユーザー同意データを直接SDKに提供します。

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.setConsentDataV2({} as AFConsentOptions);

isSDKStarted

isSDKStarted

このメソッドを使用して、現在のセッションでAppsFlyer SDKがすでに開始されているかどうかを確認します。

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.isSDKStarted();

SDKの現在の状態を確認するために使用します。

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.isSDKStopped();

AppSet IDの収集を無効にします。SDKの初期化前に呼び出された場合、App Set IDは収集されません。 初期化後に呼び出された場合、App Set IDは収集されますが、リクエストパayloadに送信されません。 Androidのみ。

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.disableAppSetId();

APIのサーバー検証用のインアプリ購入V2です。 購入の検証が成功した場合、関連する値を持つaf_purchaseイベントが自動的にログされます。

import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.validateAndLogInAppPurchaseV2({} as AFPurchaseDetailsV2);

「Source Of Truth」セクション

真実の源

このページはプラグインから生成されています。 src/definitions.ts再度、パブリック API の変更をアップストリームで実行してください。

Capacitor を使用している場合 Getting Started を使用して、ダッシュボードと __CAPGO_KEEP_0__ のオペレーションを計画するには、Capacitor を接続してください。 @API/__CAPGO_KEEP_1__-appsflyer を使用して、Native Capability を実装する @capgo/capacitor-appsflyer を使用して Native Capability を実装する場合、 for the native capability in Using @capgo/capacitor-appsflyer, API の概要の実装詳細 for the implementation detail in API Overview, Introduction Introductionの実装詳細について API キー 実装詳細についてはAPI キー、 デバイス 実装詳細についてはデバイス。