Lacrifilm Lacrifilm - 7 months ago 23
Swift Question

Filter notifications that should warn is possible?

I have an app that receive two types of notifications from my webserver (with APNS): Important Notifications and Normal Notifications.

The main difference between these two types of notifications is that

Important Notifications
should appear in the notifications bar on device (when the app is on background mode) and
normal notification
not.

Normal Notifications
is only for update some information inside my app and it is not necessary to warn users when the app is in background mode. knowing that, this kind of thing is possible?

Answer

Your backend service has to send the non-important push notification with

{"content-available":1}

in its payload dictionary. Then the user won't see the push notification on the home screen.

Comments