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アシストセットアップを使用してプラグインをインストールできます。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:
bun add @capgo/capacitor-appsflyerbunx cap syncImport
Section titled “Import”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 Overview
Section titled “API Overview”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
startSDKUse 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);updateServerUninstallToken
「updateServerUninstallToken」セクションAndroidではGCM/FCMトークン、iOSではAPNsトークンを使用して、他のプラグインが収集したトークンをパスします。 AppsFlyerにアンインストール測定トークンを転送するために使用します。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.updateServerUninstallToken({} as AFUninstall);setAppInviteOneLink
「setAppInviteOneLink」セクションインビートのAttributionのためのOneLink IDを設定します。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.setAppInviteOneLink({} as AFOnelinkID);setOneLinkCustomDomain
「setOneLinkCustomDomain」セクションAppsFlyerが短いリンクに隠したAttributionパラメータを解決できるように、ブランド化されたOneLinkドメインを登録します。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.setOneLinkCustomDomain({} as AFOnelinkDomain);appendParametersToDeepLinkingURL
「appendParametersToDeepLinkingURL」セクションOneLinkが必要ない場合のApp LinksのデープリンクのAttributionを有効にするには、このメソッドを呼び出してください。
少なくとも startSDK()クリップボードにコピー pid そしてパラメータマップにあります。 is_retargeting=true クリップボードにコピー
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.appendParametersToDeepLinkingURL({} as AFAppendToDeepLink);setResolveDeepLinkURLs
AppsFlyer OneLinkが他のUniversal Linkの中に包まれている場合に使用します。
__CAPGO_KEEP_0__は包まれた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
__CAPGO_KEEP_0__はプッシュ通知パイロットから深いリンク値を抽出する方法を設定します。Configures how the SDK extracts deep link values from push notification payloads.
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.addPushNotificationDeepLinkPath({} as AFPath);setSharingFilter
AppsFlyerパートナーにイベントを伝播させないようにします。クリップボードにコピー
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
setAdditionalDataAppsFlyerに追加のkey-valueデータを送信します。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.setAdditionalData({} as AFData);getAppsFlyerUID
setAdditionalDataAppsFlyerのユニークデバイス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);この API が呼び出された後、SDK はサーバーと通信できなくなり、機能を停止します。 ユーザーオプトイン/オプトアウトの実装に役立ちます。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.stop();disableSKAdNetwork
Section titled “disableSKAdNetwork”SKAdNetwork からオプトアウトする
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.disableSKAdNetwork({} as AFDisable);disableAdvertisingIdentifier
Section titled “disableAdvertisingIdentifier”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);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
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
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);setPartnerData
パートナー統合用のカスタムデータを送信するクリップボードにコピー
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.setPartnerData({} as AFPartnerData);logInvite
クリップボードにコピーネットワークオペレータ名(キャリア)とSIMオペレータ名の収集をオプトアウトする
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.logInvite({} as AFLogInvite);setDisableNetworkData
クリップボードにコピークリップボードにコピー
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を使用していない場合は、次の方法を使用して、consentデータを直接SDKに提供します。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.setConsentData({} as AFConsentData);logAdRevenue
「logAdRevenue」セクション広告収益を特定することで、アプリ所有者はユーザーのLTVとキャンペーンROIを完全に把握できます。 rewardedビデオ、オファー ウォール、インテリセスト、バナーなどの広告を表示することで、広告収益が生成されます。 このメソッドを使用して、広告収益を記録できます。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.logAdRevenue({} as AFAdRevenueData);setConsentDataV2
「setConsentDataV2」セクションユーザーconsentデータを手動で設定するために使用します。 TCF v2.2に互換性のあるCMPを使用していない場合は、次の方法を使用して、consentデータを直接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
「disableAppSetId」セクションAppSet ID の収集を無効にします。SDK の初期化前に呼び出された場合、App Set ID は収集されません。初期化後に呼び出された場合、App Set ID はリクエスト ペイロードに送信されません。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);ソース オブ トゥルース
ソース オブ トゥルースプラグインの生成元のページ 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 を参照してください。