@thathoff/cordova-plugin-universal-links 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -46,7 +46,7 @@ module.exports = function(ctx) {
|
|
|
46
46
|
console.log(JSON.stringify(pluginNpmDependencies, null, 2));
|
|
47
47
|
|
|
48
48
|
var npm = (process.platform === "win32" ? "npm.cmd" : "npm");
|
|
49
|
-
var result = spawnSync(npm, ['install', '--production'], { cwd: './plugins/' + ctx.opts.plugin.id });
|
|
49
|
+
var result = spawnSync(npm, ['install', '--production'], { cwd: './plugins/' + ctx.opts.plugin.id, shell: true });
|
|
50
50
|
if (result.error) {
|
|
51
51
|
throw result.error;
|
|
52
52
|
}
|
|
@@ -51,7 +51,7 @@ function readPreferences(cordovaContext) {
|
|
|
51
51
|
// region Private API
|
|
52
52
|
|
|
53
53
|
function getTeamIdPreference(xmlPreferences) {
|
|
54
|
-
if (xmlPreferences
|
|
54
|
+
if (xmlPreferences['ios-team-id']) {
|
|
55
55
|
return xmlPreferences['ios-team-id'][0]['$']['value'];
|
|
56
56
|
}
|
|
57
57
|
|
|
@@ -13,9 +13,8 @@ var mkpath = require('mkpath');
|
|
|
13
13
|
var ConfigXmlHelper = require('../configXmlHelper.js');
|
|
14
14
|
var ASSOCIATED_DOMAINS = 'com.apple.developer.associated-domains';
|
|
15
15
|
var context;
|
|
16
|
-
var projectRoot;
|
|
17
16
|
var projectName;
|
|
18
|
-
var
|
|
17
|
+
var buildTypes = ["Debug", "Release"];
|
|
19
18
|
|
|
20
19
|
module.exports = {
|
|
21
20
|
generateAssociatedDomainsEntitlements: generateEntitlements
|
|
@@ -32,10 +31,12 @@ module.exports = {
|
|
|
32
31
|
function generateEntitlements(cordovaContext, pluginPreferences) {
|
|
33
32
|
context = cordovaContext;
|
|
34
33
|
|
|
35
|
-
var
|
|
36
|
-
|
|
34
|
+
for (var i = 0; i < buildTypes.length; ++i) {
|
|
35
|
+
var currentEntitlements = getEntitlementsFileContent(buildTypes[i])
|
|
36
|
+
var newEntitlements = injectPreferences(currentEntitlements, pluginPreferences);
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
saveContentToEntitlementsFile(newEntitlements, buildTypes[i]);
|
|
39
|
+
}
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
// endregion
|
|
@@ -46,10 +47,11 @@ function generateEntitlements(cordovaContext, pluginPreferences) {
|
|
|
46
47
|
* Save data to entitlements file.
|
|
47
48
|
*
|
|
48
49
|
* @param {Object} content - data to save; JSON object that will be transformed into xml
|
|
50
|
+
* @param {String} buildType "Debug" or "Release"
|
|
49
51
|
*/
|
|
50
|
-
function saveContentToEntitlementsFile(content) {
|
|
52
|
+
function saveContentToEntitlementsFile(content, buildType) {
|
|
51
53
|
var plistContent = plist.build(content);
|
|
52
|
-
var filePath = pathToEntitlementsFile();
|
|
54
|
+
var filePath = pathToEntitlementsFile(buildType);
|
|
53
55
|
|
|
54
56
|
// ensure that file exists
|
|
55
57
|
mkpath.sync(path.dirname(filePath));
|
|
@@ -61,10 +63,11 @@ function saveContentToEntitlementsFile(content) {
|
|
|
61
63
|
/**
|
|
62
64
|
* Read data from existing entitlements file. If none exist - default value is returned
|
|
63
65
|
*
|
|
66
|
+
* @param {String} buildType "Debug" or "Release"
|
|
64
67
|
* @return {String} entitlements file content
|
|
65
68
|
*/
|
|
66
|
-
function getEntitlementsFileContent() {
|
|
67
|
-
var pathToFile = pathToEntitlementsFile();
|
|
69
|
+
function getEntitlementsFileContent(buildType) {
|
|
70
|
+
var pathToFile = pathToEntitlementsFile(buildType);
|
|
68
71
|
var content;
|
|
69
72
|
|
|
70
73
|
try {
|
|
@@ -138,14 +141,11 @@ function domainsListEntryForHost(host) {
|
|
|
138
141
|
/**
|
|
139
142
|
* Path to entitlements file.
|
|
140
143
|
*
|
|
144
|
+
* @param {String} buildType "Debug" or "Release"
|
|
141
145
|
* @return {String} absolute path to entitlements file
|
|
142
146
|
*/
|
|
143
|
-
function pathToEntitlementsFile() {
|
|
144
|
-
|
|
145
|
-
entitlementsFilePath = path.join(getProjectRoot(), 'platforms', 'ios', getProjectName(), 'Resources', getProjectName() + '.entitlements');
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
return entitlementsFilePath;
|
|
147
|
+
function pathToEntitlementsFile(buildType) {
|
|
148
|
+
return path.join(getProjectRoot(), 'platforms', 'ios', getProjectName(), 'Entitlements-' + buildType + '.plist');
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thathoff/cordova-plugin-universal-links",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Cordova plugin to add in your application support for Universal Links (iOS 9) and Deep Links (Android). Basically, open application through the link in the browser.",
|
|
5
5
|
"cordova": {
|
|
6
6
|
"id": "cordova-plugin-universal-links",
|
|
@@ -45,14 +45,7 @@
|
|
|
45
45
|
"author": "Nikolay Demyankov for Nordnet Bank AB",
|
|
46
46
|
"license": "MIT",
|
|
47
47
|
"bugs": {
|
|
48
|
-
"url": "https://github.com/
|
|
48
|
+
"url": "https://github.com/thathoff/cordova-plugin-universal-links/issues"
|
|
49
49
|
},
|
|
50
|
-
"homepage": "https://github.com/
|
|
51
|
-
"main": "index.js",
|
|
52
|
-
"directories": {
|
|
53
|
-
"doc": "docs"
|
|
54
|
-
},
|
|
55
|
-
"scripts": {
|
|
56
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
57
|
-
}
|
|
50
|
+
"homepage": "https://github.com/thathoff/cordova-plugin-universal-links"
|
|
58
51
|
}
|
package/plugin.xml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
|
|
3
|
-
<plugin id="cordova-plugin-universal-links" version="0.3.
|
|
3
|
+
<plugin id="cordova-plugin-universal-links" version="0.3.1" xmlns="http://apache.org/cordova/ns/plugins/1.0">
|
|
4
4
|
|
|
5
5
|
<name>Universal Links Plugin</name>
|
|
6
6
|
<description>
|