0

I am an app developer. I would like to initialize Flurry analytics SDK after taking consent from the user (instead of app launch).

Consent is taken in a fragment. I am using the code below in the same fragment- new FlurryAgent.Builder() .withDataSaleOptOut(false) //CCPA - the default value is false .withCaptureUncaughtExceptions(true) .withIncludeBackgroundSessionsInMetrics(true) .withLogLevel(Log.VERBOSE) .withPerformanceMetrics(FlurryPerformance.ALL) .build(getActivity(), {FLURRY_API_KEY}); However, events are not getting logged. They only start getting logged when a new activity comes up to foreground.

Can you please help me with this?

Thanking you in advance.

1 Answer 1

0

Yes, normally Flurry SDK will start session after a new activity comes up to foreground. Therefore if you initialize FlurryAgent from your Application.onCreate(), Flurry session will start when your app comes up. However, you may try to add the following calls to see whether it resolves your scenario or not.

FlurryAgent.Builder()
    ...
    .withSessionForceStart(true)
    .build(application, {FLURRY_API_KEY}); 

If it still does not work for you, also try to call the following method after FlurryAgent is initialized.

FlurryAgent.onStartSession(getApplicationContext());

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.