Closed Ghevi closed 1 year ago
Hi Ghevi, I think instead of controlling this behavior from the client side you can just solve your requirements from the server side. So when the user logs in, the token should be stored and used by the server to send the notifications to the user and as soon as the user logs out, this token will get removed from the server, so no notifications are delivered any more to this specific user.
@TobiasBuchholz i see, as i imagined. If the user needs to be online to login, it also should be able to call the server when logging out and setting the token null. Will try to push for this solution.
Sorry for opening an issue, but i wonder if there is the possibility to register and unregister manually for push notifications using the cloud messaging package. My app has a login screen, so i would like to start receiving notifications only once the user log in and when he log out, the phone stops receiving the notifications. I see the interface has two methods to subscribe and unsuscribe from topics, but i want to send notifications on single devices not to everyone. I tried this piece of code, but i'm not sure what to do on the Android case:
Thanks!