0

is there any way to limit number of remote notification?

when i receive remote notification that has same category name, wants removing last notifications.

or, is there any way to catch notification received in background?

bluetori
  • 3
  • 1
  • Possibly duplicate of https://stackoverflow.com/q/27591665/1818090 – Shyam Feb 12 '18 at 07:34
  • Possible duplicate of [How to remove specific remote notification in the notification center](https://stackoverflow.com/questions/27591665/how-to-remove-specific-remote-notification-in-the-notification-center) – Cristik Feb 12 '18 at 19:35

1 Answers1

0

You can use "silent" notifications.

Just enable Remote notifications background mode in capabilities. Update notification payload by adding this to root of payload JSON:

"content-available" : 1

Then you can handle this with UNUserNotificationCenter. Check didReceiveNotificationResponse method. (Or in app delegate)

EDIT: With this you can control when to show notification to user and numbers on application icon etc.

Petr Kramolis
  • 245
  • 2
  • 12