I am siting in a bit of a predicament and cannot find a information about a solution to the predicament on the internet even though I'm sure that someone would have encountered it.
The problem if offline log out and still receiving notifications.
I have a application where multiple accounts can log into the same device at the same time. When a user logs into the app it is registers with notification hub which we use to push notification to our users even when the user has closed the application.
Scenario:
- We have multiple users logged into one device.
- Each user has there own registration with the notification hub.
- The user logs one of the accounts out while the phone is offline.
- This in turn fails to unregister the that account from the notification hub
- The user kills the application
- The notification hub still believes that the account is still logged in.
- When the device has internet it gets the notifications that where queued up.
The question is, are there any best practices or an approach to deal with this situation. The notification holds sensitive data, so if an account has been removed for a specific reason, we shouldn't still be sending a notification to that device with information about the logged out account.