Skip to content

スタートガイド

GitHub

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

APIの概要

APIの概要

initSDK

initSDK

SDKの初期化と開始に使用します。APIはアプリが起動したときに呼び出される必要があります。

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

startSDK

startSDK

SDKの開始に使用します。マニュアルスタートモードでのみ使用してください。

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

logEvent

logEvent

インアプリイベントをログに記録します。

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

顧客ユーザーIDを設定することで、独自のユーザーIDと他のデバイスのIDをAppsFlyerの独自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のブランドドメインを登録して、短いリンクに隠されたAttributionパラメータを解決できるようにします。

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

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

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に追加のkey-valueデータを送信します。

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

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();

SKAdNetworkのオプトアウト

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

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

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 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

クリップボードにコピー

クロスプロモーションキャンペーンの印象を記録します。AppsFlyerダッシュボードで表示される推奨アプリIDを使用してください。

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

logCrossPromoteImpression

__CAPGO_KEEP_0__

__CAPGO_KEEP_1__

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

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

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

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

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

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

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

ユーザー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データを手動で設定できます。 CMPがTCF v2.2に互換性がある場合、以下のメソッドを使用して、consentデータを直接SDKに提供できます。

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

Use this method to check whether the AppsFlyer SDK has already been started in the current session.

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

Use this method to check whether the AppsFlyer SDK is currently stopped.

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

disableAppSetId

disableAppSetId

Disables AppSet ID collection. If called before SDK init, App Set ID will not be collected. If called after init, App Set ID will be collected but not sent in request payloads. Android only.

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

validateAndLogInAppPurchaseV2

validateAndLogInAppPurchaseV2

API for server verification of in-app purchases V2. An af_purchase event with the relevant values will be automatically logged if the validation is successful.

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

Section titled “Source Of Truth” src/definitions.ts. Re-run the sync when the public API changes upstream.

Capgoを使用している場合 Getting Started ダッシュボードとAPIの作業を計画するには Capgoの@capgo/capacitor-appsflyerを使用 Capgoの@capgo/capacitor-appsflyerのネイティブ機能について APIの概要 APIの実装詳細について 導入 __CAPGO_KEEP_0__のAPIキー APIの実装詳細について APIのキーの実装詳細について デバイス デバイスの実装詳細について。