Closed hoschiho closed 5 months ago
Hello,
We expect you to initialize analytics inside your Application.onCreate
.
I don't know how it works with Flutter but if you can try something like that:
class Application : FlutterApplication {
override fun onCreate() {
super.onCreate();
// Start flutter engine
// Invoke a dart code in the Plugin using methodChannel or etc.
initSRGAnalytics(config = config)
}
}
Or just don't create Player before initializing analytics.
You can update the user consent afterward with SRGAnalytics.setUserConsent
.
@hoschiho do you need more help on this issue? Or is the comment above what you were looking for?
@MGaetan89 All good :) Thanks for your help!
Description of the problem
We call
SRGAnalytics.init(application, config)
after we have consent from the user. However, in this case media player events aren't sent out. Manually triggered events like a page view event works correctly. And if we initialize it right in the main activity, everything works fine.Relevant stack trace or log output
No response
Reproducibility
Always
Steps to reproduce
Call
SRGAnalytics.init(application, config)
not right in the beginning.Library version
1.0
Operating system
Android 14
Code sample
No response
Is there an existing issue for this?