IOS Determine if there are notifications in the Notification Center.

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

+4
source share
2 answers

I am not sure if I understand you correctly. If you want to get a list of notifications from APNS, the only and β€œright” way to do this is to rely on the standard push notification mechanism (you can find this in any Push Notification tutorial). Just understand the notification when they arrive, and save them somewhere, possibly in NSArray .

It is not possible to receive push notifications when they are still on the server . This is obviously because they have not yet arrived on the device!

0
source

If you ask about push notifications: you cannot access notifications in the notification center. However, you can store all notifications on your server.

Remember that push notification delivery is not guaranteed.

From the manual for local and push notifications: Read more about push notifications

... you should never use the remote notification mechanism for data transport, as the delivery of push notifications is not guaranteed.

0
source

Source: https://habr.com/ru/post/1491917/


All Articles