-
Notifications
You must be signed in to change notification settings - Fork 534
Two entitlements files #8
Comments
This is not a bug, this is totally fine. You can have as many entitlements files as you want. From the native developer perspective, to enable Universal Links in Xcode you need to:
As a result, Xcode will generate Our plugin does all that on a
Why do I put it in the |
Excellent, thank you again for the thorough explanation. Everything is working very well, great work! |
Thanks :) |
Hi Nik, |
@MarsupiL I'm facing the same issue. I see the file under Thank you very much for your help in advance! |
Tried it on the fresh project and Can you give me some more info, please:
If I would be able to reproduce it - I should be able to fix it... |
I haven't tried on a new project yet, but I managed to fix it using the cordova-custom-config plugin to add the CODE_SIGN_ENTITLEMENTS and the content of the Entitlements-Debug.plist and Entitlements-Release.plist files introduced in Cordova-ios 4.3.0. |
Prior to 4.3.0 Cordova didn't have entitlements file, so I had to implement a custom hook that will generate it and add to the Xcode project. But now they do - so yes, one way to go is to use your approach. Although, it's strange that you are facing this issue :( |
So I created a new project and can confirm that there is a conflict with the cordova-custom-config plugin. The plugin itself does not create issues but as soon as I set any preference for an XCBuildConfiguration element in the config file it seems to remove the CODE_SIGN_ENTITLEMENTS set to |
Okay, thanks for the input, will check it out. At least now I know how to reproduce it. |
Correction: even without any custom config preference set, the custom-config plugin overrides the entitlements set in the project.pbxproj |
I'm the author of the cordova-custom-config plugin and I've finally made some time to look into this. I'm unable to reproduce a scenario where this plugin causes the loss of the reference to the entitlements file created by the universal links plugin - see this screencapture for my test results. For more details, see my last comment regarding this on the issue opened against cordova-custom-config regarding this behaviour. |
@dpa99c and @nikDemyankov this is definitely an issue for anyone who uses the Cordova CLI as its intended. If you do a "cordova platform add ios" without any plugins, and look at the build.xcconfig file for ios, this points to the Entitlements file that should contain all of your capabilities such as push, or whatever else..
When plugins modify the value of CODE_SIGN_ENTITLEMENTS for their own purposes and point to Resources/{appName}.entitlements, they dont merge with the capabilities or other config thats already set in Cordova's Entitlements-debug.plist or Entitlements-release.plist files. This messes up Cordovas automatic release/export through the CLI because now you're required to manually change capabilities before building/releasing. This is a problem for people who use the Cordova CLI as intended to where you shouldnt even need to open Xcode and can do Continuous integration builds. Basically, plugins need to upgrade their hooks to set entitlements values in Cordovas Entitlements-debug.plist and Entitlements-release.plist files that are generated with the CLI, rather than invalidating those files |
Update: I found and fixed a bug (see #108) which should resolve this issue when this plugin is used in conjunction with The fix has been published in a patch release: |
Thanks so much! I had fixed this in another plugin but that was in internal
thing. Glad we have the fix now. Cheers!
|
the problem is still there. Use https://github.com/chancezeus/cordova-universal-links-plugin in mean while, it has the problem fixed. |
👋 Hi! Thank you for your interest in this repo. 😢 We are not using nordnet/cordova-universal-links-plugin anymore, and we lack the manpower and the experience needed to maintain it. We are aware of the inconveniece that this may cause you. Feel free to use it as is, or create your own fork. 🔒 This will now be closed & locked. ℹ️ Please see #160 for more information. |
@nikDemyankov
Hi again,
One more question about the plugin. I am using Xcode 7.0.1 and before I installed your plugin, my Cordova project already had an entitlements file in the Root directory with an entry for webcredentials:mydomain.com. The name of the file being My Project.entitlements. When I do a Cordova Prepare command, the plugin adds another entitlements file in the Resources directory with applinks:www.mydomain.com and the file has the exact same name as the other entitlements file in the ROOT directory. Everything works fine with the universal links as I posted before in the other post. My question is whether this is a bug or intentional?
I also noticed that under Build Settings > Code Signing > Code Signing Entitlements is pointing the entitlements file that the plugin created in the Resources directory.
Thanks!
The text was updated successfully, but these errors were encountered: