PostHog / posthog-flutter

PostHog Flutter SDK
https://posthog.com/docs/libraries/flutter
MIT License
55 stars 37 forks source link

No config set from dart #22

Closed alexsunderlion closed 1 month ago

alexsunderlion commented 2 years ago

I haven't seen any method to set configuration(API_KEY, POSTHOG_HOST, TRACK_APPLICATION_LIFECYCLE_EVENTS, DEBUG) from dart layer. Better to have config/init function to set API_KEY and other option based on dynamic environment from flutter.

metafounder commented 2 years ago

Up on this issue. Just to be clear: currently, the only way to set configuration is to hardcode them in info.plist for iOS?

metafounder commented 1 year ago

any update on this issue?

alexsunderlion commented 1 year ago

Yes, we are only able to hardcode them in info.plist

danielmeza commented 1 year ago

I agree with this, I'm using FlutterFlow and there is now an easy way to edit platform specific code there, an init function is needed for such scenarios.

marandaneto commented 1 year ago

No updates, sorry, but we will consider it for the next major version.

Maxim-Filimonov commented 1 year ago

+1 would be great to have it as all other libs provide ability to pass tokens via init. We have different tokens for different envs and also would like to avoid hardcoding things in Info.plist

flodaniel commented 5 months ago

Adding that this is necessary to enable tracking of lifecycle events while staying compliant with cookie laws in the European Union.

marandaneto commented 5 months ago

Adding that this is necessary to enable tracking of lifecycle events while staying compliant with cookie laws in the European Union.

It's possible to disable already so it's already compliant, only needed if you want to enable it again at runtime.

marandaneto commented 4 months ago

On Android, you could have a Manifest per flavor, see comment. On iOS, you could use eg PlistBuddy, see comment.

flodaniel commented 4 months ago

In our app the users can select their region (EU vs. non-EU) at runtime, so I also want to make the choice about posthog lifecycle events at runtime.

marandaneto commented 1 month ago

PR is up