4

Is there any way to know if a local notification was dismiss from the Notification Center (for example by pressing the x button)?

Is it possible to get a list of all the notifications currently visible in the Notification Center?

Andrei Ardelean
  • 474
  • 4
  • 12

1 Answers1

5

No it's not possible to get list of notifications from any of APIs from Apple. And no there is no feedback from ignored / closed notifications.

If you want to implement logic like that, I would propose to build this type of logic based on your own servers.

  1. When you send a notification you keep information about it on server side.
  2. When you open the app from notification (that it's doable) you send information to a server side.
  3. When you open the app not from notification you can have a logic on a server side checking if there were any notification that were not confirmed from the last time you opened the application.

Keep in mind that notifications are not always delivered - it's not guarantee that user will get them and if use has notifications turned of for your application - all notifications will be treated as ignored. To improve that logic you may want to send information about user permissions for notifications to your servers - which still is not guarantee that he didn't disable them in settings :(

Long story short - never ever build any of your application core functionality based on notifications.

Grzegorz Krukowski
  • 18,081
  • 5
  • 50
  • 71
  • Its not accurate however - because not all notifications sent from the server will be received by the phone (if the phone is turned off for example it won't be delivered), and the server won't get feedback in this situation that the push was never delivered. – Gruntcakes Aug 10 '15 at 22:27
  • That's true @MartinH but there is no better way to implement something close by to that. If he want's to track that people didn't see or ignored notification - should be good enough. I will edit answer to clarify that – Grzegorz Krukowski Aug 11 '15 at 07:21