Pushy assigns your app a device token which doesn't change when a user signs in or out. If another user signs into your app on the same device, they may start receiving notifications meant for the previous user, as they now both share the same Pushy device token.
Our recommended approach to supporting multiple-user sign in flow is as follows:
When a user logs out, always clear their associated Pushy device token from your backend database, by sending a request to your backend. Whenever any user logs in to your app, send their device token to your backend for storage.
Before storing the current user's device token when they log in, check whether any other users have this exact Pushy device token assigned to them. If so, disassociate it from the other users first by clearing it from your backend database. Then, associate this Pushy device token only for the user currently logging in.
Finally, if you make use of Pub/Sub topics, you can reset the current device's Pub/Sub subscriptions by calling
Pushy.unsubscribe("*") when users log in to your app, to ensure they won't receive notifications for topics another user may have subscribed to.