nordnet / cordova-universal-links-plugin

[DEPRECATED] - Cordova plugin to support Universal/Deep Links for iOS/Android.
https://github.com/nordnet/cordova-universal-links-plugin/issues/160
MIT License
349 stars 529 forks source link

iOS Xcode 7.3.1 Associated Domains not enabled #74

Closed ghybs closed 8 years ago

ghybs commented 8 years ago

Thank you again for the great plugin!

Unfortunately when I build my Cordova project, the generated Xcode project does not have the "Associated Domains" capability enabled. I have Xcode 7.3.1. Of course I can get the functionality working by enabling it manually and filling the Domains list (as described in issue #8).

Now it would be much preferable that it gets enabled and filled with domains automatically (as the plugin is supposed to do, I guess?), so that other developers do not need to perform the manual process again everytime the Cordova project is rebuilt from source.

It looks like project.pbxproj file needs a new (?) project attribute (in PBXProject section), under project object / attributes:


TargetAttributes = {
    [targetIdentifier] = {
        DevelopmentTeam = [ios-team-id];
        SystemCapabilities = {
            com.apple.SafariKeychain = {
                enabled = 1;
            };
        };
    };
};

Please am I the only one having this bug?

nikDemyankov commented 8 years ago

Hi,

Can you share your setup in config.xml? Plugin should generate domains list file and activate Associated Domains preference in the project.

ghybs commented 8 years ago

In config.xml (Cordova project root) I have:

<universal-links>
    <ios-team-id value="[ios-team-id]" />
    <host name="[domain]" scheme="https">
        <path url="/path/*" />
    </host>
</universal-links>

Should I have something else specific to enable Associated Domains?

ghybs commented 8 years ago

I realize I have not tested yet on a plain Cordova project. I will perform further tests... Sorry to bother you.

nikDemyankov commented 8 years ago

In config.xml (Cordova project root) I have:

I realize I have not tested yet on a plain Cordova project.

How did you test it?) Anyway, try to do the following:

  1. Create new project with plugin in it:

    cordova create Test
    cd Test
    cordova platform add ios
    cordova plugin add cordova-universal-links-plugin
  2. Setup config.xml:

    <universal-links>
     <ios-team-id value="test" />
     <host name="test.com" scheme="https">
         <path url="/path/*" />
     </host>
    </universal-links>
  3. Build project:

    cordova build ios
  4. Go to platforms/ios/ and open .xcodeproj file in Xcode. And check, that entitlements file exist, and Associated Domains is activated.

This is how I've tested it.

Also, check, that you have node of version 4+.

ghybs commented 8 years ago

Thank you a lot for the detailed steps! I meant I tested on my fully loaded project, but I forgot to try on an empty one. :-S

Anyway, it looks like you are right, it seems related to node version. But I have troubles reproducing exactly my behaviour on an empty project.

BTW, I should mention I initially tested it using Meteor 1.3, which still uses node 0.10 (I had to find a workaround for child_process.spawnSync() from beforePluginInstallHook.js). Hopefully Meteor 1.4 will upgrade to node 4, but I am unsure when my host will upgrade to Meteor 1.4…

Therefore I will close this issue until I can find out exactly what causes the Associated Domains not being enabled in that configuration.

Maybe I will get node 4 in the mean time? :-) Thank you again for the above help!

nikDemyankov commented 8 years ago

You're welcome :)