Reputation: 124
I have an app to work on. And I need to know if there is already some push notifications before the app is opened. Is there a way to solving the issue?
Thanks
Upvotes: 1
Views: 217
Reputation: 9768
You can't push a notification to a device when your application hasn't been opened at least once - the user has to authorize push notifications and you need get the push token value - returned after calling registerForRemoteNotifications
- and send it to your server.
There's no guarantee that your app will see multiple push notifications if they all arrived when the application wasn't running. Often you'll just see the most recent notification. You should store all of the notifications on your server and have your application request them when it becomes active if there's at least one notification waiting for you.
Upvotes: 1