How to create Provisioning profile that include the com.apple.developer.usernotifications.filtering entitlement

I want to deploy an application that uses certain service. I created a provisioning profile but when I import it into Xcode as a signing profile it shows

Provisioning profile "MyApp Profile" doesn't include the com.apple.developer.usernotifications.filtering entitlement.

How can I have a profile that includes this?

To create a provisioning profile that includes the com.apple.developer.usernotifications.filtering entitlement, you'll need to follow these steps:

Step 1: Create an App ID with the Required Entitlement

1.Log in to your Apple Developer account:

Go to the Apple Developer website and log in.

2.Navigate to Identifiers:

Under "Certificates, Identifiers & Profiles," go to "Identifiers."

3.Create a New App ID:

Click the "+" button to add a new App ID. Enter the necessary details, such as the description and Bundle ID. Under "Capabilities," enable the "User Notifications" capability. Ensure that the "User Notifications Filtering" entitlement is selected.

Step 2: Create a Provisioning Profile

1. Go to Provisioning Profiles: Under "Certificates, Identifiers & Profiles," go to "Provisioning Profiles."

2. Create a New Provisioning Profile:

Click the "+" button to add a new profile. Select the type of profile you need (e.g., iOS App Development, App Store, Ad Hoc). Choose the App ID you just created with the com.apple.developer.usernotifications.filtering entitlement. Select the certificates to include in the profile. Choose the devices (for development or Ad Hoc profiles). Name the profile and generate it. 3. Download the Provisioning Profile:

Once generated, download the provisioning profile to your computer.

Step 3: Import the Provisioning Profile into Xcode Open Xcode:

Open your project in Xcode.

1. Import the Provisioning Profile:

Go to "Preferences" in Xcode (Xcode > Preferences). Under the "Accounts" tab, select your Apple ID and view the team. Click the "+" button to import the provisioning profile you just downloaded. 2.Set the Provisioning Profile:

Select your project in the Project Navigator. Go to the "Signing & Capabilities" tab. Under the "Team" dropdown, select your team. Ensure the correct provisioning profile is selected for the appropriate build configuration (Debug/Release).

Step 4: Verify the Entitlement in Your App

1.Check the Entitlements File: Ensure your app’s .entitlements file includes the com.apple.developer.usernotifications.filtering entitlement. If it’s not already present, add it manually.

<key>com.apple.developer.usernotifications.filtering</key>
<true/>

2.Build and Run:

Build and run your app to ensure the provisioning profile is correctly configured and includes the necessary entitlement.

Troubleshooting

  • Double-check Capabilities:

Ensure that the App ID has the correct capabilities enabled.

  • Match Bundle ID:

Make sure the Bundle ID in Xcode matches the App ID exactly.

  • Re-generate Profile:

If you’ve made changes to the App ID or capabilities, you may need to re-generate and download a new provisioning profile.

Hello I can't find User Notifications among the Capabilities list. I have Push Notifications.

Are there any specific configurations to do to have it?

Thanks

How to create Provisioning profile that include the com.apple.developer.usernotifications.filtering entitlement
 
 
Q