Siverchen
Siverchen

Reputation: 379

get push notification without click the alertview

After receiving a notification, I didn't tap the alert view. A moment later, I tap the application icon to start the application and then invoke the – applicationWillEnterForeground:. If I now would like to use the notification I just received, Where can I get it?

Upvotes: 2

Views: 263

Answers (1)

Paul Peelen
Paul Peelen

Reputation: 10329

You can't. The notification is send only once. If you did not open it when the UIAlertView was open, or opened it using the drop-down Notification Center you cannot open it the same way.

One way to check if the notification is opened or not is doing this using your server whom send out the notification. When the notification is send to the device, save it at the server side with a "opened" flag of 0. When the application is launched without using the – application:didFinishLaunchingWithOptions: delegate method in your AppDelegate having the push message as options, it can check against the server if there are any "unread" messages, and thus show them if there are any.

That is my best suggestion for your problem.

Upvotes: 3

Related Questions