Scenario -
I log into account A on Chrome and enable push notifications for new messages. Works fine.
I logout and login to account B on same browser. I want push notifications for account B when I am logged into account B.
Gmail does that when you manage multiple accounts from same browser. It shows push notifications for the currently logged in email account only.
To do such thing in my app, I have to unsubscribe from push notifications when I logout from account A and subscribe for push notifications again when I log into account B.
Is there a better way of tying that with current session?
Edit: I am thinking of registering a single client (i.e chrome browser on a machine) for multiple users and then send user ID with push notification payload to figure out whom to show the message.