1

After we noticed missing app open attribution data for some of our users we had a deeper look at the source of the cordova-plugin-appsflyer-sdk to search for a reason - and we found it:

We are setting onInstallConversionDataListener to true when initializing the SDK to receive the appropriate callbacks. Nevertheless, the onSuccess callback is not called in all cases with the attribution data. The reason for this is the way the native callbacks(onConversionDataReceived & onAppOpenAttribution) are handled in AppsFlyerPlugin.m. When starting the app with an AppsFlyer deep link, we should receive both the conversion data (native: onConversionDataReceived) and the deep link information (native: onAppOpenAttribution). The problem in the plugin implementation is that only the first of these two callbacks is forwarded to the Java script part of the code and the one that comes second is ignored, because the conversionListeners will be set to null after the first onSuccess call (AppsFlyerPlugin.m line 386, 394 and 375 https://github.com/AppsFlyerSDK/cordova-plugin-appsflyer-sdk/blob/master/src/ios/AppsFlyerPlugin.m)

Our observation shows that the native callbacks onConversionDataReceived & onAppOpenAttribution are both called correctly when we open the app from a deep link, but they are called in different sequence depending if the app is in background or not. This leads to the result that if you open the app with a deep link, only the conversion data is sent into JavaScript with onSuccess callback in the case the app was not running at all, and only the app open attribution data is sent in the case the app was in background (app resumes). The correct behaviour would be, that both the onConversionDataReceived & onAppOpenAttribution should be forwarded in both cases.

Keeping the conversionListeners (=not setting to null in line 386, 394 and maybe also 375) seems to solve the problem, but we don't know the reason why these listeners are currently being removed after their first call.

Is there a reason to reset this callbacks to null?

Abhinav Gupta
  • 2,225
  • 1
  • 14
  • 30
Kamen Goranchev
  • 1,836
  • 1
  • 23
  • 27

0 Answers0