segmentio / analytics_flutter

The hassle-free way to add Segment analytics to your Flutter app.
MIT License
29 stars 38 forks source link

How to update device token after analytics is initialized? #100

Open ggirotto opened 3 weeks ago

ggirotto commented 3 weeks ago

In this PR https://github.com/segmentio/analytics_flutter/pull/73 it seems that you guys added a new property to Configuration class which is token, but what happens if the device token is only acquired after the analytics was already initialized? Should we create a new instance of the analytics to replace the old now or use the solution proposed on this issue https://github.com/segmentio/analytics_flutter/issues/29?

edsonjab commented 2 weeks ago

hi @ggirotto we add token to change on any time on the execution process, to update the context once the Analytics was initialized you need to use the proposed solution because you can use the same instance of Analytics was declared at the beginning to update the context.