Sahir
Sahir

Reputation: 436

how to receive push notification when app is turned off?

I am implementing a push notification functionality for my app and everything is running smoothly except for one case.

The situation is this: When the app is off (not running in background either) and the user receives a push notification. The user hits "Close" and then later on decides to go to the app. I would like my app delegate to know the push notification that was received earlier however, I don't know how to check that. I know that I can have a function call in my didLaunch... but that works when the user decides to hit the "View" button instead of "Close".

Any hints?

Thanks!

Upvotes: 2

Views: 805

Answers (1)

Alan Zeino
Alan Zeino

Reputation: 4396

Really, the answer is don't bother. You can never guarantee that the alert was received, so unfortunately you'll run into problems later if you rely on this. apns doesn't guarantee a device will receive a payload.

Upvotes: 4

Related Questions