Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check for waiting notifications

With iOS 5 and the notification center you can have waiting, stacked up notifications each with their own data and message. Is there a way when your program is launched regularly (without tapping on the notification) to discover the waiting notifications and more importantly the data associated with them?

The other question associated with this is when the push notifications come in and your app is in the background does application:didReceiveLocalNotification: still get called or does it just go and wait till the app is launched and then you're expected to manually handle it with the launch data in theapplication:didFinishLaunchingWithOptions:

My scenario is that I need to update some core-data models with the data attached to the push notifications so I want those changes reflected no matter how they launch the app.

like image 371
utahwithak Avatar asked Oct 31 '11 17:10

utahwithak


1 Answers

From my experience, there is no way to find out about notifications other than launching the app directly through them (on iOS 5, that would be right after receiving the notification or from the queued notifications present at the Notification Center).

An alternate strategy would be to use icon badges.

If you badge your app icon when receiving notifications, you could check for that number every time the app is launched and then perform the required actions.

like image 57
Aloha Silver Avatar answered Oct 10 '22 03:10

Aloha Silver