@thathoff/cordova-plugin-universal-links 0.3.6 → 0.3.8-alpha.0
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.
- package/.claude/settings.local.json +11 -0
- package/hooks/afterPrepareHook.js +4 -3
- package/hooks/beforePluginInstallHook.js +2 -2
- package/hooks/lib/ios/appleAppSiteAssociationFile.js +1 -2
- package/package.json +5 -4
- package/plugin.xml +4 -1
- package/src/ios/AppDelegate+CULPlugin.h +1 -1
- package/src/ios/AppDelegate+CULPlugin.m +1 -1
- package/src/ios/CDVSceneDelegate+CULPlugin.h +15 -0
- package/src/ios/CDVSceneDelegate+CULPlugin.m +39 -0
|
@@ -8,9 +8,6 @@ data you have specified in the projects config.xml file.
|
|
|
8
8
|
var configParser = require('./lib/configXmlParser.js');
|
|
9
9
|
var androidManifestWriter = require('./lib/android/manifestWriter.js');
|
|
10
10
|
var androidWebHook = require('./lib/android/webSiteHook.js');
|
|
11
|
-
var iosProjectEntitlements = require('./lib/ios/projectEntitlements.js');
|
|
12
|
-
var iosAppSiteAssociationFile = require('./lib/ios/appleAppSiteAssociationFile.js');
|
|
13
|
-
var iosProjectPreferences = require('./lib/ios/xcodePreferences.js');
|
|
14
11
|
var ANDROID = 'android';
|
|
15
12
|
var IOS = 'ios';
|
|
16
13
|
|
|
@@ -75,6 +72,10 @@ function activateUniversalLinksInAndroid(cordovaContext, pluginPreferences) {
|
|
|
75
72
|
* @param {Object} pluginPreferences - plugin preferences from the config.xml file. Basically, content from <universal-links> tag.
|
|
76
73
|
*/
|
|
77
74
|
function activateUniversalLinksInIos(cordovaContext, pluginPreferences) {
|
|
75
|
+
var iosProjectPreferences = require('./lib/ios/xcodePreferences.js');
|
|
76
|
+
var iosProjectEntitlements = require('./lib/ios/projectEntitlements.js');
|
|
77
|
+
var iosAppSiteAssociationFile = require('./lib/ios/appleAppSiteAssociationFile.js');
|
|
78
|
+
|
|
78
79
|
// modify xcode project preferences
|
|
79
80
|
iosProjectPreferences.enableAssociativeDomainsCapability(cordovaContext);
|
|
80
81
|
|
|
@@ -19,7 +19,7 @@ var INSTALLATION_FLAG_FILE_NAME = '.npmInstalled';
|
|
|
19
19
|
function isInstallationAlreadyPerformed(ctx) {
|
|
20
20
|
var pathToInstallFlag = path.join(ctx.opts.projectRoot, 'plugins', ctx.opts.plugin.id, INSTALLATION_FLAG_FILE_NAME);
|
|
21
21
|
try {
|
|
22
|
-
fs.accessSync(pathToInstallFlag, fs.F_OK);
|
|
22
|
+
fs.accessSync(pathToInstallFlag, fs.constants.F_OK);
|
|
23
23
|
return true;
|
|
24
24
|
} catch (err) {
|
|
25
25
|
return false;
|
|
@@ -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 });
|
|
50
50
|
if (result.error) {
|
|
51
51
|
throw result.error;
|
|
52
52
|
}
|
|
@@ -20,7 +20,6 @@ Additional documentation regarding apple-app-site-association file can be found
|
|
|
20
20
|
var path = require('path');
|
|
21
21
|
var mkpath = require('mkpath');
|
|
22
22
|
var fs = require('fs');
|
|
23
|
-
var rimraf = require('rimraf');
|
|
24
23
|
var ConfigXmlHelper = require('../configXmlHelper.js');
|
|
25
24
|
var IOS_TEAM_ID = '<YOUR_TEAM_ID_FROM_MEMBER_CENTER>';
|
|
26
25
|
var ASSOCIATION_FILE_NAME = 'apple-app-site-association';
|
|
@@ -53,7 +52,7 @@ function generate(cordovaContext, pluginPreferences) {
|
|
|
53
52
|
* Remove old files from ul_web_hooks/ios folder.
|
|
54
53
|
*/
|
|
55
54
|
function removeOldFiles() {
|
|
56
|
-
|
|
55
|
+
fs.rmSync(getWebHookDirectory(), { recursive: true, force: true });
|
|
57
56
|
}
|
|
58
57
|
|
|
59
58
|
/**
|
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.8-alpha.0",
|
|
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",
|
|
@@ -36,11 +36,12 @@
|
|
|
36
36
|
}
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
|
+
"glob": ">=7.0.0",
|
|
39
40
|
"mkpath": ">=1.0.0",
|
|
40
|
-
"xml2js": ">=0.4",
|
|
41
|
-
"rimraf": ">=2.4",
|
|
42
41
|
"node-version-compare": ">=1.0.1",
|
|
43
|
-
"plist": ">=1.2.0"
|
|
42
|
+
"plist": ">=1.2.0",
|
|
43
|
+
"xcode": ">=3.0.0",
|
|
44
|
+
"xml2js": ">=0.4"
|
|
44
45
|
},
|
|
45
46
|
"author": "Nikolay Demyankov for Nordnet Bank AB",
|
|
46
47
|
"license": "MIT",
|
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.7" xmlns="http://apache.org/cordova/ns/plugins/1.0">
|
|
4
4
|
|
|
5
5
|
<name>Universal Links Plugin</name>
|
|
6
6
|
<description>
|
|
@@ -45,6 +45,9 @@
|
|
|
45
45
|
<source-file src="src/ios/AppDelegate+CULPlugin.m"/>
|
|
46
46
|
<header-file src="src/ios/AppDelegate+CULPlugin.h"/>
|
|
47
47
|
|
|
48
|
+
<source-file src="src/ios/CDVSceneDelegate+CULPlugin.m"/>
|
|
49
|
+
<header-file src="src/ios/CDVSceneDelegate+CULPlugin.h"/>
|
|
50
|
+
|
|
48
51
|
<!-- sources for JS folder -->
|
|
49
52
|
<source-file src="src/ios/JS/CDVPluginResult+CULPlugin.m" target-dir="JS/"/>
|
|
50
53
|
<header-file src="src/ios/JS/CDVPluginResult+CULPlugin.h" target-dir="JS/"/>
|
|
@@ -12,6 +12,6 @@
|
|
|
12
12
|
*/
|
|
13
13
|
@interface AppDelegate (CULPlugin)
|
|
14
14
|
|
|
15
|
-
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray *))restorationHandler;
|
|
15
|
+
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring>> *))restorationHandler;
|
|
16
16
|
|
|
17
17
|
@end
|
|
@@ -14,7 +14,7 @@ static NSString *const PLUGIN_NAME = @"UniversalLinks";
|
|
|
14
14
|
|
|
15
15
|
@implementation AppDelegate (CULPlugin)
|
|
16
16
|
|
|
17
|
-
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray *))restorationHandler {
|
|
17
|
+
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring>> *))restorationHandler {
|
|
18
18
|
// ignore activities that are not for Universal Links
|
|
19
19
|
if (![userActivity.activityType isEqualToString:NSUserActivityTypeBrowsingWeb] || userActivity.webpageURL == nil) {
|
|
20
20
|
return NO;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//
|
|
2
|
+
// CDVSceneDelegate+CULPlugin.h
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
#if __has_include(<Cordova/CDVSceneDelegate.h>)
|
|
6
|
+
|
|
7
|
+
#import <Cordova/CDVSceneDelegate.h>
|
|
8
|
+
|
|
9
|
+
@interface CDVSceneDelegate (CULPlugin)
|
|
10
|
+
|
|
11
|
+
- (void)scene:(UIScene *)scene continueUserActivity:(NSUserActivity *)userActivity;
|
|
12
|
+
|
|
13
|
+
@end
|
|
14
|
+
|
|
15
|
+
#endif
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
//
|
|
2
|
+
// CDVSceneDelegate+CULPlugin.m
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
#if __has_include(<Cordova/CDVSceneDelegate.h>)
|
|
6
|
+
|
|
7
|
+
#import "CDVSceneDelegate+CULPlugin.h"
|
|
8
|
+
#import "CULPlugin.h"
|
|
9
|
+
#import <Cordova/CDVViewController.h>
|
|
10
|
+
|
|
11
|
+
static NSString *const PLUGIN_NAME = @"UniversalLinks";
|
|
12
|
+
|
|
13
|
+
@implementation CDVSceneDelegate (CULPlugin)
|
|
14
|
+
|
|
15
|
+
- (void)scene:(UIScene *)scene continueUserActivity:(NSUserActivity *)userActivity {
|
|
16
|
+
if (![userActivity.activityType isEqualToString:NSUserActivityTypeBrowsingWeb] || userActivity.webpageURL == nil) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (![scene isKindOfClass:[UIWindowScene class]]) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
CDVViewController *viewController = (CDVViewController *)self.window.rootViewController;
|
|
25
|
+
if (![viewController isKindOfClass:[CDVViewController class]]) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
CULPlugin *plugin = [viewController getCommandInstance:PLUGIN_NAME];
|
|
30
|
+
if (plugin == nil) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
[plugin handleUserActivity:userActivity];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@end
|
|
38
|
+
|
|
39
|
+
#endif
|