AppsFlyer React Native Plugin v7.0.2
Installation
npm install react-native-appsflyer@7.0.2Then for iOS:
cd ios && pod installChanges in This Release
Upgrading from 6.18.0? See MIGRATION.md for the full before/after guide.
- React Native >> Native bridge rewritten as a New-Architecture-only TurboModule (RN ≥0.76 required)
- React Native >> Every method now takes a single params object — no more positional arguments
- React Native >> iOS native SDK 7.0.2 (
AppsFlyerRPC7.0.13); Androidaf-android-sdk7.0.1 +af-android-plugin-bridge7.0.12 - React Native >>
PurchaseConnectornative deps bumped (iOS pod → 7.0.2, Android → 2.3.0) - React Native >> Added hashed-PII setters
setUserPhone,setUserFirstName,setUserLastName,setUserFbLoginId, andclearUserPii— no 6.x equivalent - React Native >> Added
registerSessionReadyListener— required before callingstart() - React Native >> iOS AppDelegate lifecycle calls (
handleOpenURL/handleOpenUrl/continueUserActivity/handleLaunchOptions) now go throughAppsFlyerAttribution.sharedinstead ofAppsFlyerLib.shared()— only affects hand-integrated AppDelegates, not the Expo config plugin - React Native >>
ConversionData.data.is_first_launchis now a real boolean, not the string"true"/"false" - React Native >> Fix
stop(false)never resuming the SDK on Android — theshouldStopflag wasn't sent and Android's RPC parser defaults the missing key totrue, so a stopped SDK stayed stopped - React Native >> Fix
logAdRevenue'smediationNetworksilently failing on Android for severalMEDIATION_NETWORKconstants (APPLOVIN_MAX,GOOGLE_ADMOB,TOPON_PTE,CUSTOM_MEDIATION,DIRECT_MONETIZATION_NETWORK) — Android's RPC layer requires an exact string match with no normalization, while iOS lowercases and strips underscores before matching. The constant is now resolved to each platform's actual required wire value before dispatch — no change to the publicMEDIATION_NETWORKvalues themselves - React Native >> Fix
AFPurchaseType.ONE_TIME_PURCHASEexporting the wrong-layer value ("one_time_purchase", Android's wire format) instead of the shared plugin-corepublicApicontract ("oneTimePurchase") — brokevalidateAndLogInAppPurchasefor one-time purchases on iOS, which expects camelCase and applies no normalization; Android was unaffected since its own transform already converts camelCase to snake_case at dispatch - React Native >> Strict mode (
$RNAppsFlyerStrictMode=true) now pullsAppsFlyerRPC/Strict
Breaking changes
See MIGRATION.md for full before/after examples for each item below.
- Every method takes one params object — e.g.
init(devKey, appId)→init({devKey, appId}). initSdk(options)removed — replaced byinit({devKey, appId})+ explicitstart().isDebug/onInstallConversionDataListener/onDeepLinkListener/manualStartoptions removed; useenableDebug(),registerConversionListener()/registerDeepLinkListener(), andstart()instead.timeToWaitForATTUserAuthorizationhas no replacement — request ATT yourself beforeinit().onInstallConversionData/onInstallConversionFailure/onDeepLinkremoved — useregisterConversionListener()/registerDeepLinkListener()+unregisterConversionListener()/unregisterDeepLinkListener().onAppOpenAttribution/onAttributionFailure/performOnAppAttributionremoved — merged intoregisterDeepLinkListener.validateAndLogInAppPurchase(purchaseInfo, successC, errorC)removed — new signature isvalidateAndLogInAppPurchase({purchase, additionalParameters?}), no callback argument.AFPurchaseDetailssplit intoAFPurchaseDetailsAndroid/AFPurchaseDetailsIOS.generateInviteLink'sdeeplinkPathremoved — was already a no-op. Every other field now nests under aparametersobject.sendPushNotificationDatais now Android-only — on iOS usehandlePushNotification({pushPayload})instead.setUserEmailsremoved — usesetUserEmail({email})(single address only).setSharingFilterForAllPartners/setSharingFilterremoved — usesetSharingFilterForPartners.AppsFlyerConsentclass removed — usesetConsentData({isUserSubjectToGDPR, hasConsentForDataUsage?, hasConsentForAdsPersonalization?, hasConsentForAdStorage?}).PurchaseConnector's 5 listener methods (Android:onSubscriptionValidationResultSuccess/Failure,onInAppValidationResultSuccess/Failure; iOS:OnReceivePurchaseRevenueValidationInfo) now return anEmitterSubscriptioninstead of a bare unsubscribe function — call.remove()on the returned value, notunsubscribe().setCollectIMEI/initInAppPurchaseValidatorListenerremoved — no replacement.performOnDeepLinking()renamed toperformDeepLinking({url, shouldTriggerSession?})— Android-only.logEventno longer waits for server delivery — a resolved Promise now means "accepted onto the send queue", not "delivered to server".AFInAppEventType.*now imported directly:import { AFInAppEventType } from 'react-native-appsflyer'— no longer viaNativeModules.RNAppsFlyer.getConstants().- Removed TS types:
InitSDKOptions,AFAdRevenueData,AppsFlyerConsentType,InAppPurchase(useAFPurchaseDetails).
Documentation
Links
Support
For issues and questions, please contact support@appsflyer.com