Closed mattbajorek closed 11 months ago
@mattbajorek thanks for the report.
Is this happening on Android or iOS? is it happening after hot-reload or just after opening the app?
Did you configure the other things such as com.posthog.posthog.API_KEY
?
See the docs
@marandaneto I haven't tested on iOS, I was encountering this issue on Android. I have the AndroidManifest.xml as show in the docs. I didn't want to post my API_KEY, but I verified the API key was set properly.
@mattbajorek I've tried it out and can't reproduce this, I only see the Created posthog client for project with tag {tag}
, even after hot reloading.
Posthog()
is just a singleton factory, so it's not even creating an instance every time, the plugin is only installed once during app start.
Can you provide a minimum reproducible example?
Closing the issue as a part of large repository cleanup, due to it being inactive and/or outdated. Please do not hesitate to ping me if it is still relevant, and I will happily reopen and work on it. Cheers!
Version
Flutter version: >=3.0.6 <4.0.0 Posthog version: 3.3.0
Expected Result
No duplicate client should be called.
Actual Result
Duplicate posthog client created with tag: {secret posthog tag}. If you want to use multiple PostHog clients, use a different apiKey or set a tag via the builder during construction.
Steps to Reproduce