指南
AppsFlyer应用指南
使用@capgo/capacitor-appsflyer
Capacitor AppsFlyer attribution、analytics和深度链接插件
安装
bun add @capgo/capacitor-appsflyer
bunx cap sync
此插件暴露的内容
initSDK- Use this method to initialize and start AppsFlyer SDK. This API should be called as soon as the app launched.startSDK- 在手动启动模式下,仅使用此方法来启动AppsFlyer SDK。logEvent- 记录应用内事件。setCustomerUserId- 通过设置自己的客户 ID,您可以将自己的唯一 ID 与 AppsFlyer 的唯一 ID 和其他设备的 ID 进行交叉引用。该 ID 可在原始数据报告和 Postback API 中找到,用于与内部 ID 进行交叉引用。
Example Usage
initSDK
使用此方法初始化并启动 AppsFlyer SDK。此 API 应该在应用启动时立即调用。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.initSDK({} as AFInit);
startSDK
使用此方法启动 AppsFlyer SDK,仅在手动启动模式下。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.startSDK();
logEvent
记录应用内事件。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.logEvent({} as AFEvent);
setCustomerUserId
通过设置自己的客户 ID,您可以将自己的唯一 ID 与 AppsFlyer 的唯一 ID 和其他设备的 ID 进行交叉引用。该 ID 可在原始数据报告和 Postback API 中找到,用于与内部 ID 进行交叉引用。
import { AppsFlyer } from '@capgo/capacitor-appsflyer';
await AppsFlyer.setCustomerUserId({} as AFCuid);
Full Reference
- GitHub: https://github.com/Cap-go/capacitor-appsflyer/
- Docs: /docs/plugins/appsflyer/