Skip to content
This repository has been archived by the owner on Mar 15, 2024. It is now read-only.

🐛 Use getReactApplicationContext to build agent #3

Closed
wants to merge 1 commit into from

Conversation

CubeSugar
Copy link

According to the comment of getCurrentActivity method, current Activity is not suitable context for flurry agent initialization.

@poting-oath
Copy link
Collaborator

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!

@poting-oath poting-oath self-assigned this Jan 28, 2019
@poting-oath
Copy link
Collaborator

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!

@poting-oath
Copy link
Collaborator

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants