Skip to content
This repository has been archived by the owner on Oct 1, 2018. It is now read-only.

Refactored plugin hooks for newer XCode cli builds and codova >7 #129

Conversation

mark-veenstra
Copy link

Refactored the plugin hooks to be compatible with pre cordova 7 and post cordova 7. Also made sure the new entitlements style of XCode is respected, so building from command line works.

This PR solves:

I did some tests on Android and iOS and all seems to work. I did not test any path specific links, but they should work also.

My config.xml looks like this:

<widget>
  <universal-links>
    <host name="myapp.mydomain.org" scheme="https"/>
  </universal-links>
</widget>

On the domain https://myapp.mydomain.org I have a file apple-app-site-association, filled as follows:

{
    "applinks": {
        "apps": [],
        "details": [
            {
                "appID": "<MYTEAMID>.<MYAPPID>",
                "paths": [
                    "*",
                    "/"
                ]
            }
        ]
    }
}

Also I have a build.json that covers my builds, like:

{
    "android": {
        "debug": {
            "keystore": "config/android.keystore",
            "storePassword": "<pass>",
            "alias": "debug",
            "password" : "<pass>",
            "keystoreType": ""
        },
        "release": {
            "keystore": "config/android.keystore",
            "storePassword": "<pass>",
            "alias": "release",
            "password" : "<pass>",
            "keystoreType": ""
        }
    },
    "ios": {
        "debug": {
            "codeSignIdentity": "iPhone Developer",
            "developmentTeam": "<MYTEAMID>",
            "packageType": "development",
            "buildFlag": [
                "EMBEDDED_CONTENT_CONTAINS_SWIFT = YES",
                "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES=NO",
                "LD_RUNPATH_SEARCH_PATHS = \"@executable_path/Frameworks\""
            ],
            "iCloudContainerEnvironment": "Development"
        },
        "release": {
            "codeSignIdentity": "iPhone Distribution",
            "developmentTeam": "<MYTEAMID>",
            "packageType": "app-store",
            "buildFlag": [
                "EMBEDDED_CONTENT_CONTAINS_SWIFT = YES",
                "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES=NO",
                "LD_RUNPATH_SEARCH_PATHS = \"@executable_path/Frameworks\""
            ],
            "iCloudContainerEnvironment": "Production"
        }
    }
}

Now when I build from the command line all works like a charm.

…ost cordova 7. Also made sure the new entitlements style of XCode is respected, so building from command line works.
@menelike
Copy link

menelike commented Dec 8, 2017

This crashes with

  • TypeError: xml2js.Builder is not a function at Object.writeJsonAsXml.
  • hooks/lib/xmlHelper.js:36:22 at Object.writePreferences
  • android/updateAndroidManifest.js:23:15
    ...

Note: #114 works fine

}

for (var i = 0; i < preferences.hosts.length; i++) {
if (preferences.hosts[i].name === null || !/^(?!.*?www).*([a-zA-Z0-9]+(\.[a-zA-Z0-9]+)+.*)$/.test(preferences.hosts[i].name)) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is www considered invalid?

@nordnet-deprecation-bot
Copy link
Contributor

👋 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.

@nordnet nordnet locked and limited conversation to collaborators Sep 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants