Getting Started
このプラグインのインストール手順と全マークダウンガイドを含む設定の質問をコピーします。
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-appsflyer`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/appsflyer/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
インストール
「インストール」というタイトルのセクション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-appsflyerbunx 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';APIの概要
「APIの概要」のセクションinitSDK
「initSDK」のセクションこのメソッドを使用して、AppsFlyer SDKを初期化して開始します。この API は、アプリが起動したときにすぐに呼び出してください。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.initSDK({} as AFInit);startSDK
「startSDK」のセクションAppsFlyer SDK を手動起動モードで開始するには、このメソッドを使用してください。
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を設定すると、AppsFlyerの独自IDと他のデバイスのIDとをクロス参照できます。 このIDは、raw-data レポートと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);updateServerUninstallToken
「updateServerUninstallToken」セクションAndroidのGCM/FCMトークンまたはiOSのAPNsトークンを渡します。 AppsFlyerにアンインストール測定トークンを転送するために使用します。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.updateServerUninstallToken({} as AFUninstall);setAppInviteOneLink
「setAppInviteOneLink」を含むセクション招待の特定に使用されるベースリンクとしてのOneLink IDを設定します。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.setAppInviteOneLink({} as AFOnelinkID);setOneLinkCustomDomain
「setOneLinkCustomDomain」を含むセクションAppsFlyerが短リンク内の属性パラメータを解決できるように、ブランド化されたOneLinkドメインを登録します。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.setOneLinkCustomDomain({} as AFOnelinkDomain);appendParametersToDeepLinkingURL
OneLinkが必要ない場合のApp Linksのデープリンクの属性を有効にするには、このメソッドを呼び出してください。
少なくともと startSDK()パラメータマップに含める必要があります。 pid Section titled “appendParametersToDeepLinkingURL” is_retargeting=true Section titled “setOneLinkCustomDomain”
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.appendParametersToDeepLinkingURL({} as AFAppendToDeepLink);setResolveDeepLinkURLs
「setResolveDeepLinkURLs」を含むセクションAppsFlyer OneLinkが他のUniversal Linkの中に包まれている場合に使用します。 SDKが包まれたURLを解決するので、深いリンクが正しく機能します。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.setResolveDeepLinkURLs({} as AFUrls);addPushNotificationDeepLinkPath
「addPushNotificationDeepLinkPath」を含むセクションSDKがプッシュ通知のペイロードから深いリンク値を抽出する方法を設定します。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.addPushNotificationDeepLinkPath({} as AFPath);setSharingFilter
「setSharingFilter」を含むセクション指定されたAppsFlyerパートナーにイベントが伝播するのを止めます。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.setSharingFilter({} as AFFilters);setSharingFilterForAllPartners
「setSharingFilterForAllPartners」を含むセクションすべてのAppsFlyerパートナーにイベントが伝播するのを止めます。setSharingFilterを上書きします。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.setSharingFilterForAllPartners();setSharingFilterForPartners
「パートナーの共有フィルタを設定する」セクション指定されたAppsFlyerパートナーにイベントを伝播させない
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.setSharingFilterForPartners({} as AFFilters);setAdditionalData
「追加データを設定する」セクションAppsFlyerに追加のキー値データを送信する
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.setAdditionalData({} as AFData);getAppsFlyerUID
「AppsFlyerのユニークデバイスIDを取得する」セクションAppsFlyerのユニークデバイスIDを取得します (アプリの新しいインストールごとに作成)
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.getAppsFlyerUID();anonymizeUser
「ユーザーを匿名化する」セクションAppsFlyerの分析からユーザーを匿名化する (ユーザー情報を非表示にする)
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.anonymizeUser({} as AFAnonymizeUser);stop
「停止」を示すセクションAPIが呼び出された後、SDKはサーバーとの通信を停止し機能を停止します。 ユーザーによるオプトイン/オプトアウトの実装に役立ちます。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.stop();disableSKAdNetwork
「disableSKAdNetwork」を示すセクションSKAdNetworkからオプトアウト
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.disableSKAdNetwork({} as AFDisable);disableAdvertisingIdentifier
「disableAdvertisingIdentifier」を示すセクション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);disableCollectASA
「disableCollectASA」を示すセクションApple Search AdsのAttributionからオプトアウト
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.disableCollectASA({} as AFDisable);setHost
「ホストを設定する」セクションカスタムホストを設定します。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.setHost({} as AFHost);generateInviteLink
「招待リンクを生成する」セクション既存のユーザーが友人や連絡先を新しいユーザーとしてアプリに招待できるようにします。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.generateInviteLink({} as AFLinkGenerator);validateAndLogInAppPurchaseAndroid
「Androidアプリ内課金の検証とログイン」セクションAPIはサーバーによるアプリ内課金の検証のために使用されます。検証が成功した場合、関連する値を含むaf_purchaseイベントが自動的にログに記録されます。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.validateAndLogInAppPurchaseAndroid({} as AFAndroidInAppPurchase);validateAndLogInAppPurchaseIos
「iOSアプリ内課金の検証とログイン」セクション現在の契約のソース定義を参照してください。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.validateAndLogInAppPurchaseIos({} as AFIosInAppPurchase);getSdkVersion
「getSdkVersion」セクションアプリに使用されている AppsFlyer SDK のバージョンを取得します。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.getSdkVersion();enableFacebookDeferredApplinks
「enableFacebookDeferredApplinks」セクションFacebook Deferred AppLinks の収集を有効にします。Facebook SDK と Facebook アプリがターゲット/クライアント デバイスにインストールされている必要があります。 この API を AppsFlyer SDK を初期化する前に呼び出す必要があります。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.enableFacebookDeferredApplinks({} as AFFbDAL);sendPushNotificationData
「sendPushNotificationData」セクションプッシュ通知キャンペーンのデータを測定して取得します。
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
__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);setPartnerData
「パートナーデータを設定」セクションパートナー統合の目的でカスタムデータを送信することを許可します。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.setPartnerData({} as AFPartnerData);logInvite
「ログインビット」セクションインストール内イベント (af_invite) をログインするために使用します。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.logInvite({} as AFLogInvite);setDisableNetworkData
「ネットワークデータを無効にする」セクションネットワークオペレータ名 (キャリア) と SIM オペレータ名をデバイスから収集することをオプトアウトします。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.setDisableNetworkData({} as AFDisable);enableTCFDataCollection
「TCF データ収集を有効にする」セクション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();isSDKStopped
「isSDKStopped」セクションSDKの現在の状態を確認するために使用します。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.isSDKStopped();disableAppSetId
「disableAppSetId」セクションAppSet IDの収集を無効にします。SDKの初期化前に呼び出された場合、App Set IDは収集されません。 初期化後に呼び出された場合、App Set IDは収集されますが、リクエストパayloadに送信されません。 Androidのみ。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.disableAppSetId();validateAndLogInAppPurchaseV2
「validateAndLogInAppPurchaseV2」セクションAPIのサーバー検証用のインアプリ購入V2です。 購入の検証が成功した場合、関連する値を持つaf_purchaseイベントが自動的にログされます。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.validateAndLogInAppPurchaseV2({} as AFPurchaseDetailsV2);「Source Of Truth」セクション
真実の源このページはプラグインから生成されています。 src/definitions.ts再度、パブリック API の変更をアップストリームで実行してください。
Getting Started から続けてください
Getting Started から続けてくださいというセクション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 キー、 デバイス 実装詳細についてはデバイス。