How to use com.apple.developer.usernotifications.filtering entitlement

I'm working on an iOS app and I'm trying to implement notification filtering using the com.apple.developer.usernotifications.filtering entitlement. I want my app to receive only specific remote notifications based on certain criteria. However, I'm having trouble getting this entitlement to work as expected. Can you provide a step-by-step guide on how to correctly use the com.apple.developer.usernotifications.filtering entitlement for notification filtering? What are the key points and considerations I should keep in mind?

Where should I add the com.apple.developer.usernotifications.filtering entitlement? Should it be added to the main app target or an app extension?

Could you provide an example of how the entitlement key-value pairs should be structured for filtering notifications? For instance, if I want to filter notifications with a specific title and subtitle, how should I format this in the entitlements file?

How can I ensure that my entitlements file is correctly referenced in my app's target settings? Are there any specific configurations I need to be aware of?

I appreciate your assistance in helping me understand how to effectively use the com.apple.developer.usernotifications.filtering entitlement for notification filtering in my iOS app. Thank you!

Regenerate

The entitlement is added to the entitlements file as:

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>com.apple.developer.usernotifications.filtering</key><true/>

However it will only work if the entitlement is within the provisioning profiles for the app. You have to apply to Apple and request the entitlement, if they grant it then it will get added to your profile. Have you requested it from Apple?

You don't specify in the entitlements file what pushes you want filtered, you do that at run time in your notification service extension, you examine the push payload and then decide if you want the notification displayed to the user or not.

How to use com.apple.developer.usernotifications.filtering entitlement
 
 
Q