I am working on an application right now and need to determine if there are any notifications (for this app, of course) in the notification center. I'd like to know if anyone knows a way to access the app's notifications in the notification center.

- 8,890
- 7
- 62
- 65

- 461
- 1
- 3
- 14
-
Yes you can get the list of Notification , please refer to this link http://stackoverflow.com/questions/17531332/ios-find-list-of-local-notification-the-app-has-already-set – weber67 Jul 17 '13 at 16:34
2 Answers
I am not sure if I understand your correctly. If you want to retrieve the list of notifications from APNS, the only and the "proper" way to do it is to rely on standard push notification mechanism (you can find that in any Push Notification tutorial). Simply catch notification when they comes, and store them somewhere, within a NSArray
maybe.
There is no way to retrieve push notifications when they are still on the server. This is, obviously, because they haven't come to the device yet!

- 11,112
- 10
- 52
- 65
-
The main use case that refers to my question is the following: A push notification gets sent to the app when the app is closed (not running), the user opens the app not by tapping the notification but by tapping the icon. At this point, I would like to see if the app has any "pending" notifications, so therefore I figured I could check the notification center for any notifications for the app. – Josh Sklar Jul 17 '13 at 16:29
-
In that case, you should get information directly from the server when the app starts (probably the same thing that you do when the app is opened via notification). – Khanh Nguyen Jul 17 '13 at 16:35
If you ask about push notifications: You can't access notifications in the notification centre. However you can store all the notifications on your server.
Be aware that the delivery of push notifications is not guaranteed.
From Local and Push Notification Programming Guide: More About Push Notifications
... you should never use the remote-notification mechanism for data transport because delivery of push notifications is not guaranteed.

- 5,342
- 6
- 44
- 63