iOS Team Provisioning Profile” Missing UIBackgroundModes Entitlement

I’m trying to enable Background Modes (specifically for audio, background fetch, remote notifications) in my iOS SwiftUI app, but I’m getting this error:

Provisioning profile “iOS Team Provisioning Profile: [my app]” doesn’t include the UIBackgroundModes entitlement.

On the developer website when I make the provision profile It doesnt give me the option to allow background modes. I added it to the sign in capabilities seccion in X code and matched the bundle ID to the provision profile and certificate etc but it still runs this error because the provision profile doesnt have the entitlements..

Answered by DTS Engineer in 847767022

UIBackgroundModes is an Info.plist property, not an entitlement. It seems that you’ve added it to your .entitlements file, and thus Xcode is trying to create a provisioning profile to authorise it’s use as an entitlement. That can’t possibly work.

Most folks manage this property via Xcode’s Signing & Capabilities editor, which knows that this is an Info.plist property and does the right thing.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

UIBackgroundModes is an Info.plist property, not an entitlement. It seems that you’ve added it to your .entitlements file, and thus Xcode is trying to create a provisioning profile to authorise it’s use as an entitlement. That can’t possibly work.

Most folks manage this property via Xcode’s Signing & Capabilities editor, which knows that this is an Info.plist property and does the right thing.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Sooo it turned out to be that I had to remove entitlements preferences for the time being while I’m simulating on my phone apparently you don’t need them while in testing… maybe this is common knowledge but I the error info was pointing me the other direction and wasn’t helpful at all

FYI, it’s better to reply as a reply, rather than in the comments; see Quinn’s Top Ten DevForums Tips for this and other titbits.

apparently you don’t need them while in testing

The simulator doesn’t support entitlements in the same way as a real device. On a real device, entitlement claims must be authorised by a provisioning profile [1]. That’s not enforced on the simulator, so an app running in the simulator can claim any entitlement. Of course, that claim is only honoured by the simulator, so it doesn’t buy you much.

However, that’s irrelevant to UIBackgroundModes because that’s not an entitlement but rather an Info.plist property. See the documentation here.

If you try to use an Info.plist property as an entitlement:

  • Your app won’t run on a real device because a) the entitlement claim isn’t authorised by your profile, and b) there’s no way to fix that because there’s no way to create a profile that authorises this nonsensical setup.
  • Your app will run in the simulator, but it’ll ignore the property because it’s looking for it in your app’s Info.plist, not in its entitlements.

In short, no good can come from you crossing these particular streams.

And to reiterate, if you use Xcode’s Signing & Capabilities editor for this stuff, it’ll do the right thing automatically, and thus you won’t need to monkey around with property list files.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

[1] Except in some specific situations on the Mac. I talk about this in a lot more detail in TN3125 Inside Code Signing: Provisioning Profiles.

iOS Team Provisioning Profile” Missing UIBackgroundModes Entitlement
 
 
Q