[TIMOB-19911] iOS: Set Entitlements.plist keys from tiapp.xml like we do for Info.plist
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-12-22T14:13:51.000+0000 |
Affected Version/s | Release 5.0.2 |
Fix Version/s | Release 6.1.0 |
Components | iOS, Tooling |
Labels | Capabilities, ios |
Reporter | Ricardo Ramirez |
Assignee | Chris Barber |
Created | 2015-11-11T02:51:46.000+0000 |
Updated | 2017-01-24T22:35:28.000+0000 |
Description
Currently the only way to add e.g. associated domains for [Universal Links](https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/AppSearch/UniversalLinks.html#//apple_ref/doc/uid/TP40016308-CH12-SW1) or the HealthKit entitlement for the [HealthKit Module](http://labs.appcelerator.com/project/55c3c788e014044625e9b2a1/HealthKit-Module) is by using a custom Load/Create our default
Merge custom
Merge keys set in
Entitlements.plist
file in the project root:
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:mydomain.com</string>
</array>
The problem is that the Entitlements.plist
if you do so Titanium [will no longer automatically add](https://github.com/appcelerator/titanium_mobile/blob/17dc8754653daaff170ea0c18f74218168a5633e/iphone/cli/commands/_build.js#L2219-L2258) any other require entitlements, like TIMOB-19311.
What we need is for this to work exactly [like we handle](https://github.com/appcelerator/titanium_mobile/blob/17dc8754653daaff170ea0c18f74218168a5633e/iphone/cli/commands/_build.js#L1939) Info.plist
:
Load/Create our default Entitlements.plist
.
Merge custom Entitlements.plist
in the project root.
Merge keys set in tiapp.xml
under <ios>/<entitlements>
Do whatever we automatically generate, but only if the key does not already exist (alternatively, do this step after the first so it will be overwritten by the user's keys)
Ideally we would rename<ios>/<plist>
to <ios>/<info>
but that would break all apps ;)
[~rramirez] I updated the ticket to address the actual need to be able to customise
Entitlements.plist
viatiapp.xml
. /CC [~cbarber]Good ticket. I would use the
<entitlements/>
tag instead of renaming theplist
key afterwards. The behavior could be duplicated 1:1 from how we currently handle the Info.plist-merge.Would really like to see this now cert entitlements are no longer merged in xcode 8
[~rramirez] Nope. Tied up with TIMOB-23908, TIMOB-23518, and TIMOB-23786. All of which are critical. I'll get to this ticket when I get to it.
Ti SDK master PR: https://github.com/appcelerator/titanium_mobile/pull/8708 To test, add the following to your
tiapp.xml
:Can confirm that this works fine and the console logs show no errors whatsoever. Tested with; iPhone 7 MacOS 10.11.6 (15G31) Studio 4.8.1.201612050850 Ti SDK 6.1.0.v20170124071525 Appc NPM 4.2.8 Appc CLI 6.1.0 Ti CLI 5.0.11 Alloy 1.9.5 Arrow 1.10.1 Xcode 8.2 (8C38) Node v4.6.0 Java 1.7.0_80