What is the use of entitlements.plist file? - ios

I have some questions regarding entitlement file:
What is the use of entitlements file.
What happens if I don't add it.
What is the difference between myApp.entitlements and entitlements.plist?

The entitlements file defines certain capabilities of your app. Usually, the file is automatically generated by Xcode when you enable a capability for your app.
You only need the file if you enable certain capabilities, e.g. Healthkit integration. If you'd like to use these features, you have to add it. Otherwise, Apple will reject your app.
You can name the file like you want. You can also rename it as long as the build settings point to the correct file name for it.

Entitlements are announcements that “I am gonna use this feature like APPLE PAY” and provision profile will say, “Yes dear you can use Apple Pay Feature”.
Entitlements are part of the code-signed app.

myApp.entitlements is Xcode generated plist when you enable capabilities (e.g push notification) for that particular target.

Related

Cannot find App Attest Capability in XCode

According to the App Check Firebase Documentation, it is said to add the App Attest capability to your app.
However, I am not able to find any such capability in XCode. Any insights on this?
Note: We have enabled capability in the provision profiles
Documentation Link: https://firebase.google.com/docs/app-check/ios/app-attest-provider#install-sdk
Screenshot of Documentation
A Firebase developer here.
Currently you need to set App Attest environment to production in your app entitlements file. You can achieve it by adding the key directly to the file or you can follow the steps below (relevant for Xcode 12.5):
Open Signing & Capabilities tab in the settings of your app target
Press + Capability button
Select App Attest(see screenshot)
Open the corresponding entitlements file usually named like YourAppTargetName.entitlements
Set value production for App Attest Environment key(see screenshot)
Sorry if the docs don't contain enough details, we will try to make them more clear.

WatchOS and location entitlement

I've been working on adding a watchapp to a fitness tracker I already have in the app store. I've been able to load it onto my physical phone and watch without trouble in the past.
I've recently added Location tracking to the watch app, so that I can track the path the user has run/biked and show it to them on the phone when they review the workout. Since doing that, I'v been getting errors from Xcode when I try to load the app to my phone; I think these are expected errors, but I'm having trouble understanding from the docs/interface of Xcode and developer.apple.com where to make the fix.
I've added the entitlement in the watch app entitlements file:
As the error says, I've switched to manual signing and generated a new provisioning profile, but I get the same error. I don't see a place to add a location capability in the provisioning profile in developer.apple.com:
It seems like the only way for the provisioning profile to get the entitlement is from Xcode, since there's not a place to add it in developer.apple.com? That seems wrong, and isn't working in any case. I'm not finding help for my case in the Xcode docs (or I'm looking in the wrong place). Any help would be greatly appreciated.
I am using location services on iOS and watchOS, but I have nothing related to it in both entitlement files. The docs say:
Set entitlement values in order to enable iCloud, push notifications,
Apple Pay, and App Sandbox.
They don’t mention location services.
So it might be enough to delete the Location entitlement, and enable automatic signing again.
Of course, you had to set in your iOS info.plist, as required, NSLocationAlwaysAndWhenInUseUsageDescription, NSLocationAlwaysUsageDescription and NSLocationWhenInUseUsageDescription, and in your watch extension info.plist NSLocationWhenInUseUsageDescription.
Are you using latest Xcode? Did you set the entitlement in the target menus? They all have toggles now, from what I remember. Once you do that, normally Xcode can resolve signing issues for you. If you look at the signing section in Xcode, does it indicate a signing problem there? (And have you restarted Xcode at least once while trying to resolve the signing problem?)
Note that the location entitlement should be on your WatchKit Extension, not on the Watchkit App.
Have a look at the Capabilities tab (it is the one for control of Entitlements, so you do not have to edit the plist directly.)
Have you tried creating a new project as a test to see if that works? Your screenshot does not match target naming of what I see in Xcode for a WatchKit App. In Xcode 10.1, the WatchKit App plist editor will show 'app name' WatchKit App and the extension plist editor shows 'appname' WatchKit Extension. I see your screenshot showing 'blank' Watchapp Extension. Possibly you edited the project name and that is not an issue? Another thing to verify is that the plist is not corrupt.

Network Extension entitlement, how to enable it?

I need to use Network Extension features in an app, particularly to use the Proxy features. The doc says:
Except when you use the NEHotspotHelper class, you do not need to obtain entitlements from Apple to use Network Extension classes. However, you still need to enable the Network Extension entitlement via the Developer portal. To request an entitlement to use the NEHotspotHelper class, visit https://developer.apple.com/contact/network-extension.
I went to the Developer portal, but I couldn't find how to enable the Network Extension entitlement. Is it because my role is "admin" rather than "team agent"? Or someone can tell me how to enable that entitlement?
Due to the confused document and function missing of xcode 8.1, this cost me one whole week to find the solution.
Make sure you enrolled apple developer program (it's not free, you need to pay $100 per year)
Go to https://developer.apple.com/account/ios/identifier/bundle
Select Identifiers => App IDs
Click your app on the right(if there is no, you could create one with xcode),
Click edit button, check the network-extension checkbox
NOTE1: Since November 10th 2016, you dont need entitlement from apple to use network-extension
NOTE2: If you are using Hotspot Helper, go to https://developer.apple.com/contact/network-extension/
If you are using VPN Manager, simply use capability menu of xcode project config.
With Xcode 9 there is an easier way to add network extension entitlements inside Xcode.
Add your developer account to Xcode from Preferences -> Account if you didn't add before.
Select General tab from your app target and then set your developer account details.
From your app target select Capabilities tab and select the switch right of the Network Extensions. Then select the capabilties you are going to use.
Then check your YOUR_PROJECT_NAME.entitlements plist file. Capabilities you selected should be on the Network Extensions list.
As a last step check your AppId from developer portal if everything is fine.
Edit your App ID on Apple's dev portal and look for the Network Extensions capability/service. You also need Personal VPN to create and manage configurations in your app.
The Network Extensions option is new. I'm not sure when it appeared, maybe in the last six months?. It used to be you had to request permission for it and it'd show up under the provisioning profile entitlements, but now Apple's opened it up to everyone.
You might also need to add this to your entitlements file(s). At least you used to - I'm not positive about needing this with the new approach:
<key>com.apple.developer.networking.networkextension</key>
<array>
<string>app-proxy-provider</string>
<string>content-filter-provider</string>
<string>packet-tunnel-provider</string>
</array>

iTunes Connect - entitlement error

Apps that use the entitlements [com.apple.developer.homekit] must have a privacy policy URL for [English, Turkish]. If your app doesn’t use these entitlements, remove them from your app and upload a new binary.
I didn't choose home kit entitlement in App ID. Where will I remove from this entitlement ?
First check that HomeKit is off in your app's capabilities pane in Xcode:
Then remove HomeKit.framework from link step in the Build Phases pane:
Then in the developer portal, in Certificates, Identifiers and Profiles, make sure HomeKit is disabled in your App's Identifier:
Clean your project and remove derived data.
I exactly have done all of this. But still it gives me same error. Im sure the app doesn't include anything about homekit. Maybe it can be different solution for this, can't be ?

iOS How to enable Entitlements in Xcode 4.2 if I don't have a developer account

I want to learn iOS development first then buy a developer account. So I'm using a Jailbreak+AppSync+iOS 5.0.1 device for development.
Then, I want to add some lines below to Entitlements.plist but I can't find this file and of course I can't make it by myself.
<dict>
<key>com.apple.springboard.launchapplications</key>
<true/>
</dict>
From the official document, I found I can see Entitlements.plist in the shell and I see it.
codesign -d --entitlements -xxxx/Build/Products/Debug-iphoneos/MyApp.app
Then I think the Entitlements.plist file for this app must be somewhere. I just want to add some lines to it.
I also found some questions that said to enable Entitlements.plist, you should do it in Organizer/Provisioning Profiles. But that question is about iCloud. I don't need iCloud. So I want to ask, is there anyway to write to Entitlements.plist without a developer account?
[ADD]
If Xcode 4.2 or iOS 5 don't necessarily need a Entitlements.plist anymore. How can I add this entitlement (com.apple.springboard.launchapplications) to my application.
Thank you very much.
In Xcode 4.2, click your project, then TARGETS->project name->Summary, at then end of this page, check "Enable Entitlements", then you can see a file appear in your project.
It is no longer needed, but if you want to specify property in it, you can do in this way. :-)

Resources