Closed CubeSugar closed 5 years ago
Great catch! Flurry native library internally converts the passing in context to Application context at the initializing time. Yes, to be more consistent with the Flurry APIs, we will update this for the next release. Thanks!
This fix is in release 1.5.0. Due to our company's policy, we will need to merge the commit internally. Thanks for your support!
By using Application context here will cause "D FlurryAgent: There is no active Flurry session. Adding this event to deferred queue and flush them when the session initializes. Event: Some Event".
When React Native starts the main JS (index.js), an Android Activity already started. At this time, when passing an Application context to Flurry, Flurry will not start session immediately. Flurry will use Android's Activity Lifecycle listener to wait for the next Activity resumed and starts the new session. Hence cause this issue.
We will revert the change for the next release. BTW, Flurry will not keep the Context, no memory leak issue here.
According to the comment of
getCurrentActivity
method, currentActivity
is not suitable context for flurry agent initialization.