How to receive notifications that were sent to a topic before the subscription to this same

1

I am making an application in which notifications should be received only when being in a place at the moment to simulate it, I use a button that when pressed it is subscribed to topic a when you press it again to de-subscribe.

The problem is that when you are de-subscribed and sent notifications and I press the button again the application should receive the notifications that were sent as it does when it is sent when the device is turned off and when it is turned on they are received.

    
asked by Juan 06.09.2018 в 00:30
source

1 answer

0

Unfortunately, what you are saying is not possible.

When you subscribe, you can receive notifications.

FirebaseMessaging.getInstance().subscribeToTopic("news");

When you de-subscribe, you can not receive notifications as of this moment.

FirebaseMessaging.getInstance().unsubscribeFromTopic() 

If you are not subscribed to a topic and sent notifications, they can not be received unless there is a delay in sending by Google servers, but you would receive them after subscribing.

But in reality, notifications can not be received if you are not subscribed to a topic and do not accumulate waiting for you to re-subscribe to the topic using for notifications.

  

the application should receive notifications that were sent the same   what it does when it is sent when the device is turned off and   turn it on you receive these.

The difference here is that Google knows that there is a device that is waiting to receive notifications, which is not de-subscribed.

    
answered by 06.09.2018 / 01:29
source