コンテンツにジャンプ

Getting Started

GitHub

CapgoのAIアシストセットアップを使用してプラグインをインストールできます。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.

If you prefer Manual Setup, install the plugin by running the following commands and follow the platform-specific instructions below:

Terminal window
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';

Use this method to initialize and start AppsFlyer SDK. This API should be called as soon as the app launches.

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

startSDK

startSDK

Use this method to start AppsFlyer SDK, only on manual start mode.

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

logEvent

logEvent

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

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

setCustomerUserId

setCustomerUserId

自分の顧客IDを設定すると、自分のユニークIDをAppsFlyerのユニークIDと他のデバイスのIDと照合できます。 このIDは、rawデータレポートとPostback APIで利用可能です。

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

setCurrencyCode

setCurrencyCode

アプリ内購入の通貨を設定します。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);

インビートのAttributionのためのOneLink IDを設定します。

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

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

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

OneLinkが必要ない場合のApp LinksのデープリンクのAttributionを有効にするには、このメソッドを呼び出してください。 少なくとも startSDK()クリップボードにコピー pid そしてパラメータマップにあります。 is_retargeting=true クリップボードにコピー

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

Use this when an AppsFlyer OneLink is wrapped inside another Universal Link. It lets the SDK resolve the wrapped URL so deep linking still works correctly.

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

Configures how the SDK extracts deep link values from push notification payloads.

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

クリップボードにコピー

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

setSharingFilterForAllPartners

setSharingFilterForAllPartners

すべてのパートナーへのイベントの伝播を停止します。setSharingFilterを上書きします。

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

setSharingFilterForPartners

setSharingFilterForPartners

指定されたAppsFlyerパートナーへのイベントの伝播を停止します。

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

setAdditionalData

setAdditionalData

AppsFlyerに追加のkey-valueデータを送信します。

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

getAppsFlyerUID

setAdditionalData

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 がAdvertising 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);

setCurrentDeviceLanguage

setCurrentDeviceLanguage

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

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

logCrossPromoteImpression

logCrossPromoteImpression

クロスプロモーションキャンペーンの一部として、インプレッションをログします。AppsFlyerダッシュボードで表示されるプロモーションアプリIDを使用してください。

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

setUserEmails

setUserEmails

ユーザーのメールアドレスを設定し、暗号化します。

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

logLocation

logLocation

ユーザーの位置を手動でログします。

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

setPhoneNumber

電話番号を設定

SHA-256で暗号化された文字列として送信されます。

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

クリップボードにコピー

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

ネットワークオペレータ名(キャリア)とSIMオペレータ名の収集をオプトアウトする

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

クリップボードにコピー

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

ユーザーがCMPを使用する場合に、自動的にconsentデータの収集を有効/無効にするために使用します。 アプリセッション間でフラグ値が保存されます。

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

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

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

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

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

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

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

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

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

このメソッドを使用して、AppsFlyer SDK が現在停止されているかどうかを確認します。

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

AppSet ID の収集を無効にします。SDK の初期化前に呼び出された場合、App Set ID は収集されません。初期化後に呼び出された場合、App Set ID はリクエスト ペイロードに送信されません。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);

ソース オブ トゥルース

ソース オブ トゥルース

プラグインの生成元のページ src/definitions.tsパブリック API がアップストリームで変更された場合に、再度 Sync を実行してください。

Getting Started から続けて

Getting Started から続けて

あなたが Getting Started ダッシュボードと API のオペレーションを計画する場合に使用している場合 Capacitor の native capability を使用する場合に、@capgo/capacitor-appsflyer を使用してください。 Capacitor の native capability を使用する場合に、@capgo/capacitor-appsflyer を使用する場合の capgo の概要 API の概要 実装詳細については API の概要を参照してください。 概要 実装詳細については Introduction を参照してください。 API のキー 実装詳細については API Keys を参照してください。 デバイス 実装詳細については Devices を参照してください。