スタートガイド
このプラグインのインストール手順とフルマークダウンガイドを含むセットアップの誘導文をコピーしてください。
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.
インストール
「インストール」のセクション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.Manualセットアップを使用する場合は、以下のコマンドを実行してプラグインをインストールし、以下のプラットフォーム固有の指示に従ってください。
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
initSDKSDKの初期化と起動を開始するには、このメソッドを使用してください。APIはアプリ起動時に呼び出してください。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.initSDK({} as AFInit);startSDK
__CAPGO_KEEP_0__の概要SDKの起動
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.startSDK();logEvent
クリップボードにコピー__CAPGO_KEEP_0__の概要
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.logEvent({} as AFEvent);setCustomerUserId
Section titled “setCustomerUserId”顧客ユーザーIDを設定することで、独自のユーザーIDと他のデバイスのIDをAppsFlyerの独自IDと照合することができます。 このIDは、raw-data レポートとPostback APIで利用できます。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.setCustomerUserId({} as AFCuid);setCurrencyCode
Section titled “setCurrencyCode”インアプリ購入の通貨を設定します。3桁のISO 4217 codeを提供してください。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.setCurrencyCode({} as AFCurrency);updateServerUninstallToken
Section titled “updateServerUninstallToken”AndroidではGCM/FCMトークン、iOSではAPNsトークンを渡します。 この機能を使用して、他のプラグインが収集したアンインストール測定トークンをAppsFlyerに転送します。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.updateServerUninstallToken({} as AFUninstall);setAppInviteOneLink
Section titled “setAppInviteOneLink”インベイトのAttributionのための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
「appendParametersToDeepLinkingURL」を設定App Linksのデープリンクの属性を有効にするには、このメソッドを呼び出してください。少なくとも startSDK()と pid パラメータマップ内に含める必要があります。 is_retargeting=true クリップボードにコピー
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.appendParametersToDeepLinkingURL({} as AFAppendToDeepLink);setResolveDeepLinkURLs
AppsFlyerのOneLinkが他のUniversal Linkの中にwrapされている場合に使用してください。
__CAPGO_KEEP_0__がwrapされたURLを解決できるようにするため、デープリンクが正しく機能するようにします。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);addPushNotificationDeepLinkPath
“addPushNotificationDeepLinkPath”セクションのタイトルプッシュ通知パayloadから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
“setSharingFilterForPartners”セクションのタイトルAppsFlyerの指定されたパートナーにイベントを伝播させないようにします。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.setSharingFilterForPartners({} as AFFilters);setAdditionalData
Section titled “setAdditionalData”AppsFlyerの追加データを設定します。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.setAdditionalData({} as AFData);getAppsFlyerUID
Section titled “getAppsFlyerUID”AppsFlyerのユニークデバイスIDを取得します。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.getAppsFlyerUID();anonymizeUser
Section titled “anonymizeUser”AppsFlyerのユーザーデータを匿名化します。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.anonymizeUser({} as AFAnonymizeUser);Once this API is invoked, our SDK no longer communicates with our servers and stops functioning. Useful when implementing user opt-in/opt-out.
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の収集を無効にします。この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
「setHost」セクションカスタムホストを設定
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.setHost({} as AFHost);generateInviteLink
「generateInviteLink」セクション既存のユーザーが友人や連絡先を新しいユーザーとしてアプリに招待することを許可する
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.generateInviteLink({} as AFLinkGenerator);validateAndLogInAppPurchaseAndroid
「validateAndLogInAppPurchaseAndroid」セクションAPI を使用したサーバーでのアプリ内購入の検証。検証が成功すると、 af_purchase イベントに必要な値が自動的にログに記録されます。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.validateAndLogInAppPurchaseAndroid({} as AFAndroidInAppPurchase);validateAndLogInAppPurchaseIos
「validateAndLogInAppPurchaseIos」セクション現在の契約のソース定義を参照してください。
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
Facebook Deferred AppLinksの有効化Facebook Deferred AppLinksの収集を有効にします。Facebook SDK と Facebook アプリがターゲット/クライアント デバイスにインストールされている必要があります。この API を AppsFlyer SDK を初期化する前に呼び出す必要があります。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.enableFacebookDeferredApplinks({} as AFFbDAL);sendPushNotificationData
プッシュ通知データの送信プッシュ通知キャンペーンのデータを取得します。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.sendPushNotificationData({} as AFPushPayload);setCurrentDeviceLanguage
デバイスの言語を設定データはRaw Data Reportsに表示されます。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.setCurrentDeviceLanguage({} as AFLanguage);logCrossPromoteImpression
クロスプロモーションキャンペーンの印象を記録クロスプロモーションキャンペーンの印象を記録します。AppsFlyer ダッシュボードで表示されるアプリIDを使用してください。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.logCrossPromoteImpression({} as AFPromotion);setUserEmails
Section titled “setUserEmails”ユーザーEメールを設定し、暗号化します。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.setUserEmails({} as AFEmails);logLocation
Section titled “logLocation”ユーザーの位置を手動でログします。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.logLocation({} as AFLatLng);setPhoneNumber
Section titled “setPhoneNumber”SHA-256で暗号化された文字列として送信されます。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.setPhoneNumber({} as AFPhone);setPartnerData
Section titled “setPartnerData”パートナーの統合用にカスタムデータを送信することを許可します。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.setPartnerData({} as AFPartnerData);logInvite
「logInvite」セクションユーザー招待イベントをログインするために使用します (af_invite).
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.logInvite({} as AFLogInvite);setDisableNetworkData
「setDisableNetworkData」セクションネットワークオペレータ名 (キャリア) と SIM オペレータ名を収集しないようにオプトアウトします。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.setDisableNetworkData({} as AFDisable);enableTCFDataCollection
「enableTCFDataCollection」セクションユーザーが CMP を使用する場合に自動的にconsentデータの収集を有効/無効にします。 フラグ値はアプリのセッション間で保持されます。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.enableTCFDataCollection({} as AFEnableTCFDataCollection);setConsentData
「setConsentData」セクションユーザーconsentデータを手動で設定します。 TCF v2.2に互換性のあるCMPを使用しないアプリの場合、直接SDKにconsentデータを提供するために使用します。
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」セクションこのメソッドを使用して、AppsFlyer SDKが現在停止されているかどうかを確認できます。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.isSDKStopped();disableAppSetId
disableAppSetIdAppSet IDの収集を無効にする。SDKの初期化前に呼び出された場合、App Set IDは収集されません。初期化後に呼び出された場合、App Set IDはリクエストパayloadに送信されません。Androidのみ。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.disableAppSetId();validateAndLogInAppPurchaseV2
validateAndLogInAppPurchaseV2APIのサーバー検証用のin-app購入V2のための。購入の検証が成功した場合、関連する値を持つaf_purchaseイベントが自動的にログされます。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.validateAndLogInAppPurchaseV2({} as AFPurchaseDetailsV2);真実の源
このページはプラグインのpublic __CAPGO_KEEP_0__がアップストリームで変更された場合、再度Syncを実行してください。 src/definitions.ts. Re-run the sync when the public API changes upstream.
Capgoを使用している場合 Getting Started APIを使用してダッシュボードとAPIの操作を計画するには Capacitorを使用して@capgo/capacitor-appsflyerを接続する Capacitorのnative機能を使用するための@capgo/capacitor-appsflyer APIの概要 APIの実装詳細 Capgoの概要 __CAPGO_KEEP_0__の実装詳細 API Keys for the implementation detail in API Keys, and Capgoの実装詳細 デバイスの実装詳細について。