Summary
We are trying to add AppsFlyer's Advanced-Matching Data Sharing by upgrading to the SDK v7. @segment/analytics-react-native-plugin-appsflyer does not support react-native-appsflyer 7.x.
Version 7.0.0 replaced the native bridge with a TurboModule RPC layer. It removed initSdk and the
three onX listener closures. The plugin calls all four. Its peer dependency also pins ^6.9.4,
which excludes 7.x.
The latest published plugin (0.9.0, 2026-03-03) still calls the removed API:
src/AppsflyerPlugin.tsx |
Call |
:94 |
appsFlyer.initSdk(...) |
:122 |
appsFlyer.onInstallConversionData(...) |
:174 |
appsFlyer.onAppOpenAttribution(...) |
:197 |
appsFlyer.onDeepLink(...) |
This blocks the upgrade completely. The plugin is the only caller of initSdk in a Segment-managed
setup, and it reads appsFlyerDevKey from the Segment destination settings. An app that upgrades to
7.x therefore never initializes AppsFlyer at all.
Proposed Solution
Migrate the nine call sites and bump the peer dependency to support both major versions, or ship a
new major that targets 7.x.
Call site replacements
| File |
6.x |
7.0.x |
AppsflyerPlugin.tsx:94 |
initSdk({devKey, appId, ...}) |
init({devKey, appId}), then start() inside registerSessionReadyListener |
AppsflyerPlugin.tsx:122 |
onInstallConversionData(cb) |
registerConversionListener({onConversionDataSuccess, onConversionDataFail}) |
AppsflyerPlugin.tsx:174 |
onAppOpenAttribution(cb) |
folds into registerDeepLinkListener |
AppsflyerPlugin.tsx:197 |
onDeepLink(cb) |
registerDeepLinkListener({onDeepLinking}) |
methods/track.ts:25,31 |
logEvent(name, values) |
logEvent({eventName, eventValues}) |
methods/identify.ts:10 |
setCustomerUserId(uid) |
setCustomerUserId({customerId}) |
methods/identify.ts:36 |
setCurrencyCode(code) |
setCurrencyCode({currencyCode}) |
methods/identify.ts:40 |
setAdditionalData(data) |
setAdditionalData({customData}) |
Three ordering rules 7.x requires
- Call
registerDeepLinkListener before init(). Android drops a deep-link result that arrives
before a listener attaches, permanently.
- Register every other listener synchronously after
init(), not inside init().then(...).
- Call
start() only inside the registerSessionReadyListener callback. Native never auto-starts.
Two behavior changes to handle
onAppOpenAttribution and onDeepLink both emit Deep Link Opened today. They merge into one
registerDeepLinkListener in 7.x, so a direct port double-fires that event. Emit it once.
timeToWaitForATTUserAuthorization (AppsflyerPlugin.tsx:56, default 60) has no replacement.
Dropping it silently shortens the iOS ATT window and degrades attribution. Please document the
change, and consider exposing a hook so apps can request ATT before init().
The deep-link payload shape also changed. 7.x normalizes it to {status, error?, deepLink?}, so
callbacks reading data.data need to read data.deepLink.
Summary
We are trying to add AppsFlyer's Advanced-Matching Data Sharing by upgrading to the SDK v7.
@segment/analytics-react-native-plugin-appsflyerdoes not supportreact-native-appsflyer7.x.Version 7.0.0 replaced the native bridge with a TurboModule RPC layer. It removed
initSdkand thethree
onXlistener closures. The plugin calls all four. Its peer dependency also pins^6.9.4,which excludes 7.x.
The latest published plugin (0.9.0, 2026-03-03) still calls the removed API:
src/AppsflyerPlugin.tsx:94appsFlyer.initSdk(...):122appsFlyer.onInstallConversionData(...):174appsFlyer.onAppOpenAttribution(...):197appsFlyer.onDeepLink(...)This blocks the upgrade completely. The plugin is the only caller of
initSdkin a Segment-managedsetup, and it reads
appsFlyerDevKeyfrom the Segment destination settings. An app that upgrades to7.x therefore never initializes AppsFlyer at all.
Proposed Solution
Migrate the nine call sites and bump the peer dependency to support both major versions, or ship a
new major that targets 7.x.
Call site replacements
AppsflyerPlugin.tsx:94initSdk({devKey, appId, ...})init({devKey, appId}), thenstart()insideregisterSessionReadyListenerAppsflyerPlugin.tsx:122onInstallConversionData(cb)registerConversionListener({onConversionDataSuccess, onConversionDataFail})AppsflyerPlugin.tsx:174onAppOpenAttribution(cb)registerDeepLinkListenerAppsflyerPlugin.tsx:197onDeepLink(cb)registerDeepLinkListener({onDeepLinking})methods/track.ts:25,31logEvent(name, values)logEvent({eventName, eventValues})methods/identify.ts:10setCustomerUserId(uid)setCustomerUserId({customerId})methods/identify.ts:36setCurrencyCode(code)setCurrencyCode({currencyCode})methods/identify.ts:40setAdditionalData(data)setAdditionalData({customData})Three ordering rules 7.x requires
registerDeepLinkListenerbeforeinit(). Android drops a deep-link result that arrivesbefore a listener attaches, permanently.
init(), not insideinit().then(...).start()only inside theregisterSessionReadyListenercallback. Native never auto-starts.Two behavior changes to handle
onAppOpenAttributionandonDeepLinkboth emitDeep Link Openedtoday. They merge into oneregisterDeepLinkListenerin 7.x, so a direct port double-fires that event. Emit it once.timeToWaitForATTUserAuthorization(AppsflyerPlugin.tsx:56, default 60) has no replacement.Dropping it silently shortens the iOS ATT window and degrades attribution. Please document the
change, and consider exposing a hook so apps can request ATT before
init().The deep-link payload shape also changed. 7.x normalizes it to
{status, error?, deepLink?}, socallbacks reading
data.dataneed to readdata.deepLink.