At a glance: API reference to integrate AppsFlyer SDK into iOS/Android apps developed with React Native to measure installs, in-app events, media sources, and more.
Related reading
For a complete picture of working with the React Native plugin in AppsFlyer, be sure to read these articles:
- React Native plugin overview
- React Native plugin integration
- React Native API reference (this article)
Methods
initSDK
Description |
Initialize the AppsFlyer SDK with the dev key and app ID. The dev key is required for all apps, while the app ID is required only for iOS. (You can pass the app ID on Android as well, and it will be ignored. |
Method signature |
|
Example |
|
trackAppLaunch (deprecated)
Description |
Two functions:
|
Method signature |
|
Example |
|
onInstallConversionData
Description |
Allows access of AppsFlyer attribution/conversion data from the SDK (deferred deep linking). The code implementation for the conversion listener must be made prior to the initialization code of the SDK. |
Method signature |
|
Example |
|
onAppOpenAttribution
Description |
Get deep link data when the app opens via a deep link. |
Method signature |
|
Example |
|
logEvent
Description |
Sends in-app events to AppsFlyer. See recording in-app events. |
Method signature |
|
Example |
|
setCustomerUserId
Description |
Sets the Customer User ID (CUID). See setting the Customer User ID. |
Method signature |
|
Example |
|
getAppsFlyerUID
Description |
Get the AppsFlyer ID. For more information see here. |
Method signature |
|
Example |
|
stop
Description |
Stop all SDK functionality. See user privacy (opt-out). |
Method signature |
|
Example |
|
logLocation
Description |
Manually record the location of the user. |
Method signature |
|
Example |
|
setUserEmails
Description |
Set and encrypt user emails. |
Method signature |
|
Example |
|
setAdditionalData
Description |
Adds additional data to be sent to external partner platforms. |
Method signature |
|
Example |
|
updateServerUninstallToken - Android only
Description |
Manually pass the Firebase/GCM device token for uninstall measurement. |
Method signature |
|
Example |
|
setCollectIMEI - Android only
Description |
Indicates if the IMEI should be sent to AppsFlyer. |
Method signature |
|
Example |
|
setCollectAndroidID - Android only
Description |
Indicates if the Android ID should be sent to AppsFlyer. |
Method signature |
|
Example |
|
setAppInviteOneLinkID
Description |
Set the OneLink template ID for creating custom attribution links for user invites. Used together with generateInviteLink. |
Method signature |
|
Example |
|
generateInviteLink
Description |
Set the OneLink ID before calling this method. The link generator builds the invite URL.
|
Method signature |
|
Example |
|
logCrossPromotionImpression
Description |
Used to attribute an impression use the following API call. Make sure to use the promoted app ID as it displays within the AppsFlyer dashboard. |
Method signature |
|
Example |
|
logCrossPromotionAndOpenStore
Description |
Used to attribute the click and launch the app store's app page. |
Method signature |
|
Example |
|
setCurrencyCode
Description |
Sets the currency code for all events.
|
Method signature |
|
Example |
|
setDeviceTrackingDisabled
Description |
Used to anonymize specific user identifiers within AppsFlyer analytics. This complies with both the latest privacy requirements (GDPR, COPPA) and Meta's data and privacy policies. |
Method signature |
|
Example |
|
setOneLinkCustomDomains
Description |
Used during the SDK initialization to indicate set OneLink custom links/branded domains. Learn more about Branded Links. |
Method signature |
|
Example |
|
setResolveDeepLinkURLs
Description |
Used during the SDK initialization to indicate that links from certain domains (domains used by ESP when wrapping your deep links) should be resolved in order to get the original deep link. Learn more. |
Method signature |
|
Example |
|
performOnAppAttribution
Description |
This function allows developers to manually re-trigger onAppOpenAttribution with a specific link (URI or URL), without recording a new re-engagement. |
Method signature |
|
Example |
|
setSharingFilterForAllPartners
Description |
Used by advertisers to exclude all networks/integrated partners from getting data. Learn more. |
Method signature |
|
Example |
|
setSharingFilter
Description |
Used by advertisers to set some (one or more) networks/integrated partners to exclude from getting data. Learn more. |
Method signature |
|
Example |
|