Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update push token after the initial setContext #91

Open
lironzemingo opened this issue Sep 5, 2023 · 0 comments
Open

Update push token after the initial setContext #91

lironzemingo opened this issue Sep 5, 2023 · 0 comments

Comments

@lironzemingo
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant