
Security News
Anthropic Identifies Biased Reasoning and Recklessness as Drivers of Claude’s PyPI Attack
Anthropic found biased reasoning and recklessness drove Claude Mythos 5 to publish malware on PyPI and compromise a security vendor.
@capgo/capacitor-appsflyer
Advanced tools
Capacitor plugin for AppsFlyer attribution, analytics, and deep links.
AppsFlyer attribution and deep-linking support for Capacitor 8 apps, packaged in Capgo's plugin layout with CocoaPods and Swift Package Manager support.
This package is based on the official AppsFlyer Capacitor plugin and the Capacitor 8 / SPM update work from AppsFlyerSDK/appsflyer-capacitor-plugin#185.
Edit: the Capacitor 8 has been resolved you can now consider this fork deprecated.
The most complete doc is available here: https://capgo.app/docs/plugins/appsflyer/
| Plugin version | Capacitor compatibility | Maintained |
|---|---|---|
| v8.. | v8.. | ✅ |
Note: The major version of this plugin follows the major version of Capacitor. Use the version that matches your Capacitor installation.
You can use our AI-Assisted Setup to install the plugin. Add the Capgo skills to your AI tool using the following command:
npx skills add https://github.com/cap-go/capacitor-skills --skill capacitor-plugins
Then use the following prompt:
Use the `capacitor-plugins` skill from `cap-go/capacitor-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-appsflyer
bunx cap sync
import { AppsFlyer, AFConstants } from '@capgo/capacitor-appsflyer';
AppsFlyer.addListener(AFConstants.CONVERSION_CALLBACK, (event) => {
console.log('AppsFlyer conversion event', event);
});
await AppsFlyer.initSDK({
devKey: 'YOUR_DEV_KEY',
appID: 'YOUR_IOS_APP_ID',
registerConversionListener: true,
registerOnDeepLink: true,
});
Call initSDK() as early as possible during app startup. Use manualStart: true if you want to separate initialization from startSDK().
appID is required for iOS and should match your Apple App Store numeric app ID.AFConstants channel names exported by the package.disableSKAdNetwork() is iOS-only and disableAppSetId() is Android-only.addListener(AFConstants.CONVERSION_CALLBACK, ...)addListener(AFConstants.OAOA_CALLBACK, ...)addListener(AFConstants.UDL_CALLBACK, ...)initSDK(...)startSDK()logEvent(...)setCustomerUserId(...)setCurrencyCode(...)updateServerUninstallToken(...)setAppInviteOneLink(...)setOneLinkCustomDomain(...)appendParametersToDeepLinkingURL(...)setResolveDeepLinkURLs(...)addPushNotificationDeepLinkPath(...)setSharingFilter(...)setSharingFilterForAllPartners()setSharingFilterForPartners(...)setAdditionalData(...)getAppsFlyerUID()anonymizeUser(...)stop(...)disableSKAdNetwork(...)disableAdvertisingIdentifier(...)disableCollectASA(...)setHost(...)generateInviteLink(...)validateAndLogInAppPurchaseAndroid(...)validateAndLogInAppPurchaseIos(...)getSdkVersion()enableFacebookDeferredApplinks(...)sendPushNotificationData(...)setCurrentDeviceLanguage(...)logCrossPromoteImpression(...)setUserEmails(...)logLocation(...)setPhoneNumber(...)setPartnerData(...)logInvite(...)setDisableNetworkData(...)enableTCFDataCollection(...)setConsentData(...)logAdRevenue(...)setConsentDataV2(...)isSDKStarted()isSDKStopped()disableAppSetId()validateAndLogInAppPurchaseV2(...)addListener(eventName: AFConstants.CONVERSION_CALLBACK, listenerFunc: (event: OnConversionDataResult) => void) => PluginListenerHandle
| Param | Type |
|---|---|
eventName | AFConstants.CONVERSION_CALLBACK |
listenerFunc | (event: OnConversionDataResult) => void |
Returns: PluginListenerHandle
addListener(eventName: AFConstants.OAOA_CALLBACK, listenerFunc: (event: OnAppOpenAttribution) => void) => PluginListenerHandle
| Param | Type |
|---|---|
eventName | AFConstants.OAOA_CALLBACK |
listenerFunc | (event: OnAppOpenAttribution) => void |
Returns: PluginListenerHandle
addListener(eventName: AFConstants.UDL_CALLBACK, listenerFunc: (event: OnDeepLink) => void) => PluginListenerHandle
| Param | Type |
|---|---|
eventName | AFConstants.UDL_CALLBACK |
listenerFunc | (event: OnDeepLink) => void |
Returns: PluginListenerHandle
initSDK(options: AFInit) => Promise<AFRes>
Use this method to initialize and start AppsFlyer SDK. This API should be called as soon as the app launched.
| Param | Type |
|---|---|
options | AFInit |
Returns: Promise<AFRes>
startSDK() => Promise<AFRes>
Use this method to start AppsFlyer SDK, only on manual start mode.
Returns: Promise<AFRes>
logEvent(data: AFEvent) => Promise<AFRes>
Log an in-app event.
| Param | Type |
|---|---|
data | AFEvent |
Returns: Promise<AFRes>
setCustomerUserId(cuid: AFCuid) => Promise<void>
Setting your own customer ID enables you to cross-reference your own unique ID with AppsFlyer's unique ID and other devices' IDs. This ID is available in raw-data reports and in the Postback APIs for cross-referencing with your internal IDs.
| Param | Type |
|---|---|
cuid | AFCuid |
setCurrencyCode(currencyCode: AFCurrency) => Promise<void>
Sets the currency for in-app purchases. The currency code should be a 3 character ISO 4217 code
| Param | Type |
|---|---|
currencyCode | AFCurrency |
updateServerUninstallToken(token: AFUninstall) => Promise<void>
(Android) Allows to pass GCM/FCM Tokens that where collected by third party plugins to the AppsFlyer server. Can be used for Uninstall log. (iOS) Allows to pass APN Tokens that where collected by third party plugins to the AppsFlyer server. Can be used for log Uninstall.
| Param | Type |
|---|---|
token | AFUninstall |
setAppInviteOneLink(id: AFOnelinkID) => Promise<void>
Set the OneLink ID that should be used for attributing user-Invite. The link that is generated for the user invite will use this OneLink as the base link.
| Param | Type |
|---|---|
id | AFOnelinkID |
setOneLinkCustomDomain(domains: AFOnelinkDomain) => Promise<void>
In order for AppsFlyer SDK to successfully resolve hidden (decoded in shortlink ID) attribution parameters, any domain that is configured as a branded domain in the AppsFlyer Dashboard should be provided to this method.
| Param | Type |
|---|---|
domains | AFOnelinkDomain |
appendParametersToDeepLinkingURL(data: AFAppendToDeepLink) => Promise<void>
Enables app owners using App Links for deep linking (without OneLink) to attribute sessions initiated via a domain associated with their app. Call this method before calling start. You must provide the following parameters in the parameters Map: pid is_retargeting must be set to true
| Param | Type |
|---|---|
data | AFAppendToDeepLink |
setResolveDeepLinkURLs(urls: AFUrls) => Promise<void>
Advertisers can wrap an AppsFlyer OneLink within another Universal Link. This Universal Link will invoke the app but any deep linking data will not propagate to AppsFlyer. setResolveDeepLinkURLs enables you to configure the SDK to resolve the wrapped OneLink URLs, so that deep linking can occur correctly.
| Param | Type |
|---|---|
urls | AFUrls |
addPushNotificationDeepLinkPath(path: AFPath) => Promise<void>
Configures how the SDK extracts deep link values from push notification payloads.
| Param | Type |
|---|---|
path | AFPath |
setSharingFilter(filters: AFFilters) => Promise<void>
Stops events from propagating to the specified AppsFlyer partners.
| Param | Type |
|---|---|
filters | AFFilters |
setSharingFilterForAllPartners() => Promise<void>
Stops events from propagating to all AppsFlyer partners. Overwrites setSharingFilter.
setSharingFilterForPartners(filters: AFFilters) => Promise<void>
Stops events from propagating to the specified AppsFlyer partners.
| Param | Type |
|---|---|
filters | AFFilters |
setAdditionalData(additionalData: AFData) => Promise<void>
Set additional data to be sent to AppsFlyer. See
| Param | Type |
|---|---|
additionalData | AFData |
getAppsFlyerUID() => Promise<AFUid>
Get AppsFlyer's unique device ID (created for every new install of an app).
Returns: Promise<AFUid>
anonymizeUser(anonymize: AFAnonymizeUser) => Promise<void>
End User Opt-Out from AppsFlyer analytics (Anonymize user data).
| Param | Type |
|---|---|
anonymize | AFAnonymizeUser |
stop(stop?: AFStop | undefined) => Promise<AFIsStopped>
Once this API is invoked, our SDK no longer communicates with our servers and stops functioning. Useful when implementing user opt-in/opt-out.
| Param | Type |
|---|---|
stop | AFStop |
Returns: Promise<AFIsStopped>
disableSKAdNetwork(stop: AFDisable) => Promise<void>
Opt-out of SKAdNetwork
| Param | Type |
|---|---|
stop | AFDisable |
disableAdvertisingIdentifier(stop: AFDisable) => Promise<void>
Disables collection of various Advertising IDs by the SDK. This includes Apple Identity for Advertisers (IDFA), Google Advertising ID (GAID), OAID and Amazon Advertising ID (AAID).
| Param | Type |
|---|---|
stop | AFDisable |
disableCollectASA(stop: AFDisable) => Promise<void>
Opt-out of Apple Search Ads attributions.
| Param | Type |
|---|---|
stop | AFDisable |
setHost(hostName: AFHost) => Promise<void>
Set a custom host.
| Param | Type |
|---|---|
hostName | AFHost |
generateInviteLink(params: AFLinkGenerator) => Promise<AFLink>
Allowing your existing users to invite their friends and contacts as new users to your app
| Param | Type |
|---|---|
params | AFLinkGenerator |
Returns: Promise<AFLink>
validateAndLogInAppPurchaseAndroid(purchaseData: AFAndroidInAppPurchase) => Promise<AFRes>
API for server verification of in-app purchases. An af_purchase event with the relevant values will be automatically logged if the validation is successful.
| Param | Type |
|---|---|
purchaseData | AFAndroidInAppPurchase |
Returns: Promise<AFRes>
validateAndLogInAppPurchaseIos(purchaseData: AFIosInAppPurchase) => Promise<AFRes>
| Param | Type |
|---|---|
purchaseData | AFIosInAppPurchase |
Returns: Promise<AFRes>
getSdkVersion() => Promise<AFRes>
Get the AppsFlyer SDK version used in app.
Returns: Promise<AFRes>
enableFacebookDeferredApplinks(enable: AFFbDAL) => Promise<AFRes>
Enable the collection of Facebook Deferred AppLinks. Requires Facebook SDK and Facebook app on target/client device. This API must be invoked before initializing the AppsFlyer SDK in order to function properly.
| Param | Type |
|---|---|
enable | AFFbDAL |
Returns: Promise<AFRes>
sendPushNotificationData(payload: AFPushPayload) => Promise<void>
Measure and get data from push-notification campaigns.
| Param | Type |
|---|---|
payload | AFPushPayload |
setCurrentDeviceLanguage(language: AFLanguage) => Promise<AFRes>
Set the language of the device. The data will be displayed in Raw Data Reports
| Param | Type |
|---|---|
language | AFLanguage |
Returns: Promise<AFRes>
logCrossPromoteImpression(data: AFPromotion) => Promise<AFRes>
logs an impression as part of a cross-promotion campaign. Make sure to use the promoted App ID as it appears within the AppsFlyer dashboard.
| Param | Type |
|---|---|
data | AFPromotion |
Returns: Promise<AFRes>
setUserEmails(emails: AFEmails) => Promise<AFRes>
Set the user emails and encrypt them.
| Param | Type |
|---|---|
emails | AFEmails |
Returns: Promise<AFRes>
logLocation(latLng: AFLatLng) => Promise<AFRes>
Manually log the location of the user
| Param | Type |
|---|---|
latLng | AFLatLng |
Returns: Promise<AFRes>
setPhoneNumber(phone: AFPhone) => Promise<AFRes>
Will be sent as an SHA-256 encrypted string.
| Param | Type |
|---|---|
phone | AFPhone |
Returns: Promise<AFRes>
setPartnerData(data: AFPartnerData) => Promise<AFRes>
Allows sending custom data for partner integration purposes.
| Param | Type |
|---|---|
data | AFPartnerData |
Returns: Promise<AFRes>
logInvite(data: AFLogInvite) => Promise<AFRes>
Use to log a user-invite in-app event (af_invite).
| Param | Type |
|---|---|
data | AFLogInvite |
Returns: Promise<AFRes>
setDisableNetworkData(disable: AFDisable) => Promise<void>
Use to opt-out of collecting the network operator name (carrier) and sim operator name from the device.
| Param | Type | Description |
|---|---|---|
disable | AFDisable | Defaults to false |
enableTCFDataCollection(shouldEnableTCFDataCollection: AFEnableTCFDataCollection) => Promise<void>
Use to opt-in/out the automatic collection of consent data, for users who use a CMP. Flag value will be persisted between app sessions.
| Param | Type |
|---|---|
shouldEnableTCFDataCollection | AFEnableTCFDataCollection |
setConsentData(data: AFConsentData) => Promise<void>
Use to set user consent data manualy. if your app doesn't use a CMP compatible with TCF v2.2, use the following method to manualy provide the consent data directly to the SDK.
| Param | Type | Description |
|---|---|---|
data | AFConsentData | : AppsFlyerConsent object. |
logAdRevenue(data: AFAdRevenueData) => Promise<void>
By attributing ad revenue, app owners gain the complete view of user LTV and campaign ROI. Ad revenue is generated by displaying ads on rewarded videos, offer walls, interstitials, and banners in an app. You can use this method to log your ad revenue.
| Param | Type |
|---|---|
data | AFAdRevenueData |
setConsentDataV2(options: AFConsentOptions) => Promise<void>
Use this to set user consent data manualy. if your app doesn't use a CMP compatible with TCF v2.2, use the following method to manualy provide the consent data directly to the SDK.
| Param | Type | Description |
|---|---|---|
options | AFConsentOptions | : AFConsentOptions that consists with all the possible options for consent collection, boolean params. |
isSDKStarted() => Promise<AFIsStarted>
Use this method to check whether the AppsFlyer SDK has already been started in the current session.
Returns: Promise<AFIsStarted>
isSDKStopped() => Promise<AFIsStopped>
Use this method to check whether the AppsFlyer SDK is currently stopped.
Returns: Promise<AFIsStopped>
disableAppSetId() => Promise<void>
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.
validateAndLogInAppPurchaseV2(data: AFPurchaseDetailsV2) => Promise<{ [key: string]: any; }>
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.
| Param | Type | Description |
|---|---|---|
data | AFPurchaseDetailsV2 | - Object containing purchaseDetails and optional additionalParameters |
Returns: Promise<{ [key: string]: any; }>
| Prop | Type |
|---|---|
remove | () => Promise<void> |
| Prop | Type |
|---|---|
callbackName | string |
errorMessage | string |
data | any |
| Prop | Type |
|---|---|
callbackName | string |
errorMessage | string |
data | any |
| Prop | Type |
|---|---|
status | string |
error | string |
deepLink | any |
| Prop | Type |
|---|---|
res | string |
| Prop | Type |
|---|---|
devKey | string |
appID | string |
isDebug | boolean |
waitForATTUserAuthorization | number |
registerConversionListener | boolean |
registerOnAppOpenAttribution | boolean |
registerOnDeepLink | boolean |
useUninstallSandbox | boolean |
useReceiptValidationSandbox | boolean |
minTimeBetweenSessions | number |
deepLinkTimeout | number |
manualStart | boolean |
| Prop | Type |
|---|---|
eventName | string |
eventValue | any |
| Prop | Type |
|---|---|
cuid | string |
| Prop | Type |
|---|---|
currencyCode | string |
| Prop | Type |
|---|---|
token | string |
| Prop | Type |
|---|---|
onelinkID | string |
| Prop | Type |
|---|---|
domains | string[] |
| Prop | Type |
|---|---|
contains | string |
parameters | StringMap |
| Prop | Type |
|---|---|
urls | string[] |
| Prop | Type |
|---|---|
path | string[] |
| Prop | Type |
|---|---|
filters | string[] |
| Prop | Type |
|---|---|
additionalData | any |
| Prop | Type |
|---|---|
uid | string |
| Prop | Type |
|---|---|
anonymizeUser | boolean |
| Prop | Type |
|---|---|
isStopped | boolean |
| Prop | Type |
|---|---|
stop | boolean |
| Prop | Type |
|---|---|
shouldDisable | boolean |
| Prop | Type |
|---|---|
hostPrefixName | string |
hostName | string |
| Prop | Type |
|---|---|
link | string |
| Prop | Type |
|---|---|
brandDomain | string |
campaign | string |
channel | string |
referrerName | string |
referrerImageURL | string |
referrerCustomerId | string |
baseDeeplink | string |
addParameters | StringMap |
| Prop | Type |
|---|---|
publicKey | string |
signature | string |
purchaseData | string |
price | string |
| Prop | Type |
|---|---|
inAppPurchase | string |
price | string |
transactionId | string |
| Prop | Type |
|---|---|
enableFacebookDAL | boolean |
| Prop | Type |
|---|---|
pushPayload | StringMap |
| Prop | Type |
|---|---|
language | string |
| Prop | Type |
|---|---|
appID | string |
campaign | string |
parameters | StringMap |
| Prop | Type |
|---|---|
emails | string[] |
encode | boolean |
| Prop | Type |
|---|---|
latitude | number |
longitude | number |
| Prop | Type |
|---|---|
phone | string |
| Prop | Type |
|---|---|
data | any |
partnerId | string |
| Prop | Type |
|---|---|
eventParameters | StringMap |
channel | string |
| Prop | Type |
|---|---|
shouldEnableTCFDataCollection | boolean |
| Prop | Type |
|---|---|
data | IAppsFlyerConsent |
| Prop | Type |
|---|---|
isUserSubjectToGDPR | boolean |
hasConsentForDataUsage | boolean |
hasConsentForAdsPersonalization | boolean |
| Prop | Type |
|---|---|
monetizationNetwork | string |
mediationNetwork | MediationNetwork |
currencyIso4217Code | string |
revenue | number |
additionalParameters | StringMap |
| Prop | Type |
|---|---|
isUserSubjectToGDPR | boolean | null |
hasConsentForDataUsage | boolean | null |
hasConsentForAdsPersonalization | boolean | null |
hasConsentForAdStorage | boolean | null |
| Prop | Type |
|---|---|
isStarted | boolean |
| Prop | Type |
|---|---|
purchaseDetails | AFPurchaseDetails |
additionalParameters | StringMap |
| Prop | Type |
|---|---|
purchaseType | AFPurchaseType |
purchaseToken | string |
productId | string |
| Members | Value |
|---|---|
onConversionDataSuccess | 'onConversionDataSuccess' |
onConversionDataFail | 'onConversionDataFail' |
onAppOpenAttribution | 'onAppOpenAttribution' |
onAttributionFailure | 'onAttributionFailure' |
CONVERSION_CALLBACK | 'conversion_callback' |
OAOA_CALLBACK | 'oaoa_callback' |
UDL_CALLBACK | 'udl_callback' |
| Members | Value |
|---|---|
IRONSOURCE | 'ironsource' |
APPLOVIN_MAX | 'applovin_max' |
GOOGLE_ADMOB | 'google_admob' |
FYBER | 'fyber' |
APPODEAL | 'appodeal' |
ADMOST | 'admost' |
TOPON | 'topon' |
TRADPLUS | 'tradplus' |
YANDEX | 'yandex' |
CHARTBOOST | 'chartboost' |
UNITY | 'unity' |
TOPON_PTE | 'topon_pte' |
CUSTOM_MEDIATION | 'custom_mediation' |
DIRECT_MONETIZATION_NETWORK | 'direct_monetization_network' |
| Members | Value |
|---|---|
oneTimePurchase | 'one_time_purchase' |
subscription | 'subscription' |
FAQs
Capacitor plugin for AppsFlyer attribution, analytics, and deep links.
The npm package @capgo/capacitor-appsflyer receives a total of 103 weekly downloads. As such, @capgo/capacitor-appsflyer popularity was classified as not popular.
We found that @capgo/capacitor-appsflyer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.

Security News
Anthropic found biased reasoning and recklessness drove Claude Mythos 5 to publish malware on PyPI and compromise a security vendor.

Research
/Security News
Malicious Chrome and Firefox extensions target Axiom Trade and Padre users, stealing session tokens and wallet data.

Security News
GPT-6 Astra hits 100% on ExploitBench and finds zero-days autonomously, while independent tests reveal scope violations and monitoring gaps.