NSE Filtering
There is a note on the documentation about this:
To silence a remote notification, you must set the apns-push-type header field to alert when you send the notification to the APNS server. Otherwise, the system always displays the notification banner to the user.
Hi. I am facing same problem, I got access to use entitlement but notification is not being hidden. I tried it with both sandbox and production env. My notification payload is
[AnyHashable("aps"): { alert = { body = "Tap to explore"; title = APP Name; }; badge = 0; "content-available" = 1; "mutable-content" = 1; }]
As described here com.apple.developer.usernotifications.filtering you have to use an extension and then to call contentHandler(UNNotificationContent())
to suppress a notification. As for the APS-Payload "mutable-content" has to be set and it has to be an alert. Without "mutable-content" your notification is not being called.
Hello I have the same problem The model of my notification is
{
"headers": {
"apns-push-type": "alert"
},
"aps": {
"alert": {
"title": "Test title",
"body": "You have received a new message."
},
"mutable-content": 1
}
}
I can catch notification in UNNotificationServiceExtension
but i can't filter it with contentHandler(UNNotificationContent())