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.