Receive the latest Push notification if the application has not been launched by clicking the View button

I am wondering if there is a way to get the last push notification received if the application is launched from the main screen, and not by clicking the "View" button in the notification.

The application we are writing is designed to work with confidential data, and it is important that the central server can remotely disconnect the client at its discretion, without requiring the application to start an Internet connection.

The main idea that I came up with for this is to send a push notification with a user payload that allows the application to know in order to disconnect itself until it can correctly synchronize its data.

This will work if the user clicked the "View" button in the notification, but did not cancel it, and then launched the application separately.

I would like to know if this is possible, or otherwise, if there is a better way to implement this functionality.

+4
source share
2 answers

It's impossible. Your application will have to connect to the server at startup and get the latest status from it. If your use case is sensitive, push notifications are probably not reliable enough because Apple does not guarantee that push notifications will actually be sent.

+1
source

As Ole said, impossible.

Please note that you should not rely on push notifications for anything like this. From Apple's push notification configuration guide :

Remember that delivery of notifications is "best effort" and is not guaranteed. 
+1
source

All Articles