appsflyer-android-app
appsflyer-android-app copied to clipboard
AppsFlyerConversionListener not triggered.
Hi, found an issue. According to documentation startTracking
can be postponed until you receive user consent due to GDPR or CCPA requirements, etc.(https://support.appsflyer.com/hc/en-us/articles/207032126-Android-SDK-integration-for-developers#integration-34-delaying-initializing-the-sdk)
In case of startTracking will be called with Application context after MainActivity.onResume() AppsFlyerConversionListener wouldn't be called until activity's onResume() will be triggered again.
Hey @raman-branavitski!
As mentioned in the doc you refer to, please make sure to pass Activity instance as a context argument and not Application.
Yes, that's a problem. In documentation there isn't any information that I should pass Activity context. Otherwise conversationListener doesn't work.
@raman-branavitski here is the section with the relevant instructions. Please let us know if anything is yet not clear
Ok, thanks. The problem is that I don't call startTracking()
inside Activity
class. We have AppsFlyerManager
class which encapsulate all logic with Appsflyer integration. This class initialized inside Application
class with it's context(Application context). Also AppsFlyerManager
starts listen GDPR status(accepted or not) and when user accept GDPR it call startTracking
with Application context(at this moment activity's onResume() is already passed).
To summarize. I can call startTracking()
with application context only right after init()
. If startTracking()
should be postponed I should call it with ONLY Activity context. Right?
@raman-branavitski Thanks for elaborating, understand the challenge more clearly now. You are correct, to make sure late initialization is done properly, you should pass Activity class as the context argument. The reason behind that is that our SDK needs to inspect Activity's intent to see if it contains any deep link data. In fact, I get your point and will check internally if we can improve in this area or give you some other solution
Thanks Vitaly