Replies: 1 comment 2 replies
-
I was under the impression that invalidating a token worked? Doing that on logout should be a valid way to stop a stream of messages for a previously registered / cloud-stored token from continuing to go to the device |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
It seems as though registration tokens are unique only to the installed app and so some additional consideration has to be given for apps that allow multiple users. I have been trying to find best practices using Firebase Cloud Messaging as far as this goes but curious if anyone here has any?
One idea I have seen is to delete the token on log out, but that doesn't seem to guarantee the token will be new for the next user.
Another idea I have seen is to use data-only notifications and check the userId against the logged in user's id. However, if the current user does not match, the intended user does not get a notification even when they log in next (although this could be stored somehow to force a local notification when that happens).
Also, in general, once a token has been registered, if a user logs out they would still get notification messages unless their token was unregistered.
Beta Was this translation helpful? Give feedback.
All reactions