flutter-segment
flutter-segment copied to clipboard
Update push token after the initial setContext
Hi, I'm using Firebase messaging to get the device token and send it to Segment, using
await Segment.setContext({
'device': {
'token': yourTokenString
},
});
await Segment.track(eventName: 'Application Opened');
the thing is, that Firebase has an 'onTokenRefresh' event, where the might be updated.
in that case - how do I update the token? if I use the code above, and the only way the token is propagated is by calling Segment.track(eventName: 'Application Opened'); then that might mess up my events, won't it?