@thathoff/cordova-plugin-universal-links 0.3.7 → 0.4.0-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/README.md CHANGED
@@ -1,14 +1,12 @@
1
1
  # Cordova Universal Links Plugin
2
+
2
3
  This Cordova plugin adds support for opening an application from the browser when user clicks on the link. Better known as:
3
4
  - [Universal Links on iOS](https://developer.apple.com/library/ios/documentation/General/Conceptual/AppSearch/UniversalLinks.html)
4
5
  - [Deep Linking on Android](https://developer.android.com/training/app-indexing/deep-linking.html)
5
6
 
6
7
  ## This Project Is a Fork
7
8
 
8
- This repo is a fork of the deprecated 'nordnet/cordova-universal-links-plugin' cordova plugin. This fork adds un-merged pull requests from the original and un-maintained project.
9
-
10
- Original repo with pull requests, forks and issues:
11
- https://github.com/nordnet/cordova-universal-links-plugin
9
+ This repo is a fork of the deprecated 'nordnet/cordova-universal-links-plugin' and `eldadfux/cordova-plugin-universal-links` cordova plugin. This fork adds support for Cordova 8 and adds some unmerged merge requests and removed some unnecessary dependencies.
12
10
 
13
11
  ## Getting Started
14
12
 
@@ -28,43 +26,58 @@ It is important not only to redirect users to your app from the web, but also pr
28
26
  **Note:** At the moment the plugin doesn't support custom url schemes, but they can be added later.
29
27
 
30
28
  ## Supported Platforms
29
+
31
30
  - Android 4.0.0 or above.
32
31
  - iOS 9.0 or above. Xcode 7 is required. To build plugin with Xcode 6 - [read the instructions](#how-to-build-plugin-in-xcode-6) below.
33
32
 
34
33
  **iOS Note:** you can use this plugin in iOS 8 applications. It will not crash the app, but it also is not gonna handle the links, because this is iOS 9 feature.
35
34
 
36
35
  ## Documentation
37
- - [Installation](#installation)
38
- - [Migrating from previous versions](#migrating-from-previous-versions)
39
- - [How to build plugin in Xcode 6](#how-to-build-plugin-in-xcode-6)
40
- - [Cordova config preferences](#cordova-config-preferences)
41
- - [Application launch handling](#application-launch-handling)
42
- - [Android web integration](#android-web-integration)
43
- - [Modify web pages](#modify-web-pages)
44
- - [Verify your website on Webmaster Tools](#verify-your-website-on-webmaster-tools)
45
- - [Connect your app in the Google Play console](#connect-your-app-in-the-google-play-console)
46
- - [Digital Asset Links support](#digital-asset-links-support)
47
- - [Testing UL for Android locally](#testing-ul-for-android-locally)
48
- - [iOS web integration](#ios-web-integration)
49
- - [Activate UL support in member center](#activate-ul-support-in-member-center)
50
- - [Configure apple-app-site-association file for website](#configure-apple-app-site-association-file-for-website)
51
- - [Testing iOS application](#testing-ios-application)
52
- - [Useful notes on Universal Links for iOS](#useful-notes-on-universal-links-for-ios)
53
- - [They don't work everywhere](#they-dont-work-everywhere)
54
- - [How links handled in Safari](#how-links-handled-in-safari)
55
- - [Additional documentation links](#additional-documentation-links)
36
+
37
+ - [Cordova Universal Links Plugin](#cordova-universal-links-plugin)
38
+ - [This Project Is a Fork](#this-project-is-a-fork)
39
+ - [Getting Started](#getting-started)
40
+ - [Supported Platforms](#supported-platforms)
41
+ - [Documentation](#documentation)
42
+ - [Installation](#installation)
43
+ - [Migrating from previous versions](#migrating-from-previous-versions)
44
+ - [From v1.0.x to v1.1.x](#from-v10x-to-v11x)
45
+ - [How to build plugin in Xcode 6](#how-to-build-plugin-in-xcode-6)
46
+ - [Cordova config preferences](#cordova-config-preferences)
47
+ - [host](#host)
48
+ - [path](#path)
49
+ - [ios-team-id](#ios-team-id)
50
+ - [Prevent Android from creating multiple app instances](#prevent-android-from-creating-multiple-app-instances)
51
+ - [Application launch handling](#application-launch-handling)
52
+ - [Android web integration](#android-web-integration)
53
+ - [Modify web pages](#modify-web-pages)
54
+ - [Verify your website on Webmaster Tools](#verify-your-website-on-webmaster-tools)
55
+ - [Connect your app in the Google Play console](#connect-your-app-in-the-google-play-console)
56
+ - [Digital Asset Links support](#digital-asset-links-support)
57
+ - [Testing UL for Android locally](#testing-ul-for-android-locally)
58
+ - [iOS web integration](#ios-web-integration)
59
+ - [Activate UL support in member center](#activate-ul-support-in-member-center)
60
+ - [Configure apple-app-site-association file for website](#configure-apple-app-site-association-file-for-website)
61
+ - [Step 1](#step-1)
62
+ - [Step 2](#step-2)
63
+ - [Step 3](#step-3)
64
+ - [Testing iOS application](#testing-ios-application)
65
+ - [Useful notes on Universal Links for iOS](#useful-notes-on-universal-links-for-ios)
66
+ - [They don't work everywhere](#they-dont-work-everywhere)
67
+ - [How links handled in Safari](#how-links-handled-in-safari)
68
+ - [Additional documentation links](#additional-documentation-links)
56
69
 
57
70
  ### Installation
58
71
  This requires cordova 5.0+ (current stable 1.2.1)
59
72
 
60
73
  ```sh
61
- cordova plugin add cordova-universal-links-plugin
74
+ cordova plugin add @thathoff/cordova-plugin-universal-links
62
75
  ```
63
76
 
64
77
  It is also possible to install via repo url directly (**unstable**)
65
78
 
66
79
  ```sh
67
- cordova plugin add https://github.com/nordnet/cordova-universal-links-plugin.git
80
+ cordova plugin add https://github.com/thathoff/cordova-plugin-universal-links.git
68
81
  ```
69
82
 
70
83
  ### Migrating from previous versions
@@ -9,7 +9,6 @@ https://developer.android.com/training/app-indexing/enabling-app-indexing.html
9
9
 
10
10
  var fs = require('fs');
11
11
  var path = require('path');
12
- var mkpath = require('mkpath');
13
12
  var ConfigXmlHelper = require('../configXmlHelper.js');
14
13
  var WEB_HOOK_FILE_PATH = path.join('ul_web_hooks', 'android', 'android_web_hook.html');
15
14
  var WEB_HOOK_TPL_FILE_PATH = path.join('plugins', 'cordova-plugin-universal-links', 'ul_web_hooks', 'android_web_hook_tpl.html');
@@ -153,7 +152,7 @@ function saveWebHook(projectRoot, hookContent) {
153
152
  */
154
153
  function createDirectoryIfNeeded(dir) {
155
154
  try {
156
- mkpath.sync(dir);
155
+ fs.mkdirSync(dir, { recursive: true });
157
156
  } catch (err) {
158
157
  console.log(err);
159
158
  }
@@ -18,7 +18,6 @@ Additional documentation regarding apple-app-site-association file can be found
18
18
 
19
19
 
20
20
  var path = require('path');
21
- var mkpath = require('mkpath');
22
21
  var fs = require('fs');
23
22
  var ConfigXmlHelper = require('../configXmlHelper.js');
24
23
  var IOS_TEAM_ID = '<YOUR_TEAM_ID_FROM_MEMBER_CENTER>';
@@ -127,7 +126,7 @@ function saveContentToFile(filePrefix, content) {
127
126
  */
128
127
  function createDirectoriesIfNeeded(dirPath) {
129
128
  try {
130
- mkpath.sync(dirPath);
129
+ fs.mkdirSync(dirPath, { recursive: true });
131
130
  } catch (err) {
132
131
  console.log(err);
133
132
  }
@@ -9,7 +9,6 @@ Script only generates content. File it self is included in the xcode project in
9
9
  var path = require('path');
10
10
  var fs = require('fs');
11
11
  var plist = require('plist');
12
- var mkpath = require('mkpath');
13
12
  var ConfigXmlHelper = require('../configXmlHelper.js');
14
13
  var ASSOCIATED_DOMAINS = 'com.apple.developer.associated-domains';
15
14
  var context;
@@ -54,7 +53,7 @@ function saveContentToEntitlementsFile(content, buildType) {
54
53
  var filePath = pathToEntitlementsFile();
55
54
 
56
55
  // ensure that file exists
57
- mkpath.sync(path.dirname(filePath));
56
+ fs.mkdirSync(path.dirname(filePath), { recursive: true });
58
57
 
59
58
  // save it's content
60
59
  fs.writeFileSync(filePath, plistContent, 'utf8');
@@ -62,7 +61,7 @@ function saveContentToEntitlementsFile(content, buildType) {
62
61
  // cordova-ios 8+ uses App/ as the project source dir, so also write there
63
62
  var appResourcesPath = path.join(getProjectRoot(), 'platforms', 'ios', 'App', 'Resources', getProjectName() + '.entitlements');
64
63
  if (appResourcesPath !== filePath) {
65
- mkpath.sync(path.dirname(appResourcesPath));
64
+ fs.mkdirSync(path.dirname(appResourcesPath), { recursive: true });
66
65
  fs.writeFileSync(appResourcesPath, plistContent, 'utf8');
67
66
  }
68
67
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thathoff/cordova-plugin-universal-links",
3
- "version": "0.3.7",
3
+ "version": "0.4.0-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",
@@ -37,7 +37,6 @@
37
37
  ],
38
38
  "dependencies": {
39
39
  "glob": ">=7.0.0",
40
- "mkpath": ">=1.0.0",
41
40
  "node-version-compare": ">=1.0.1",
42
41
  "plist": ">=1.2.0",
43
42
  "xcode": ">=3.0.0",
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.7" xmlns="http://apache.org/cordova/ns/plugins/1.0">
3
+ <plugin id="cordova-plugin-universal-links" version="0.4.0" 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
package/CHANGELOG.md DELETED
@@ -1,84 +0,0 @@
1
- # Change Log
2
-
3
- ## 1.2.1 (2016-10-23)
4
-
5
- **Bug fixes:**
6
-
7
- - [Issue #79](https://github.com/nordnet/cordova-universal-links-plugin/issues/79). Fixed installation error: header files were added to the compile section of the project.
8
- - [Issue #77](https://github.com/nordnet/cordova-universal-links-plugin/issues/77). Fixed `before_prepare` hook for iOS that crashed on several systems. Thanks to [@lunchbag](https://github.com/lunchbag) for providing a fix.
9
-
10
- **Enhancements:**
11
-
12
- - [Issue #93](https://github.com/nordnet/cordova-universal-links-plugin/issues/93). Fixed iOS build warnings.
13
-
14
- ## 1.2.0 (2016-07-27)
15
-
16
- **Enhancements:**
17
-
18
- - [Merged pull request #56](https://github.com/nordnet/cordova-universal-links-plugin/pull/56). Adds support for wildcard domains. Thanks to [@schmidt](https://github.com/schmidt) for implementation.
19
-
20
- **Docs:**
21
-
22
- - [Merged pull request #67](https://github.com/nordnet/cordova-universal-links-plugin/pull/67). Added `Prevent Android from creating multiple app instances` section. Thanks to [@yernandus](https://github.com/yernandus).
23
- - [Merged pull request #70](https://github.com/nordnet/cordova-universal-links-plugin/pull/70). Added `Digital Asset Links support` section. Thanks to [@ghybs](https://github.com/ghybs).
24
-
25
- ## 1.1.2 (2016-04-27)
26
-
27
- **Bug fixes:**
28
-
29
- - [Issue #27](https://github.com/nordnet/cordova-universal-links-plugin/issues/27). From now on dependency packages will be installed in the plugin's folder instead of the project's root folder.
30
-
31
- ## 1.1.1 (2016-03-17)
32
-
33
- **Bug fixes:**
34
-
35
- - [Issue #52](https://github.com/nordnet/cordova-universal-links-plugin/issues/52). Fixed `config.xml` file preferences reading. Thanks to [@ikostic](https://github.com/ikostic) for providing fix.
36
- - [Issue #47](https://github.com/nordnet/cordova-universal-links-plugin/issues/47). If `paths` in `apple-app-site-association` file contains only `*` - we will also add `/`, so that app would be opened from root domain.
37
- - Merged [PR #42](https://github.com/nordnet/cordova-universal-links-plugin/pull/42). Fixed Android web integration on Android 6.0. Thanks to [@mohamed-ahmed](https://github.com/mohamed-ahmed).
38
-
39
- **Docs:**
40
-
41
- - Merged [PR #50](https://github.com/nordnet/cordova-universal-links-plugin/pull/50). Fixed typo in documentation. Thanks to [@rafaellop](https://github.com/rafaellop).
42
- - Merged [PR #43](https://github.com/nordnet/cordova-universal-links-plugin/pull/43). Updated documentation regarding `apple-app-site-association` file. Thanks to [@Chun-Yang](https://github.com/Chun-Yang).
43
- - Updated `Useful notes on Universal Links for iOS` section. Thanks to [@conor-mac-aoidh](https://github.com/conor-mac-aoidh) for providing information.
44
-
45
- ## 1.1.0 (2015-12-18)
46
-
47
- **Bug fixes:**
48
-
49
- - [Issue #26](https://github.com/nordnet/cordova-universal-links-plugin/issues/26). Fixed support for multiple wildcards in path. Thanks to [@tdelmas](https://github.com/tdelmas) for helping with solution.
50
- - Other minor bug fixes.
51
-
52
- **Enhancements:**
53
-
54
- - [Issue #18](https://github.com/nordnet/cordova-universal-links-plugin/issues/18). Added JS module through which you can subscribe for launch events. Solves timing issue with the previous `document.addEventListener()` approach.
55
- - [Issue #20](https://github.com/nordnet/cordova-universal-links-plugin/issues/20). Lowered min iOS version to 8.0. Plugin want work on devices prior to iOS 9, but if your application includes this plugin - it now will run on iOS 8 devices. Before you had to drop iOS 8 support.
56
- - [Issue #22](https://github.com/nordnet/cordova-universal-links-plugin/issues/22). Plugin now compatible with Cordova v5.4.
57
- - [Issue #24](https://github.com/nordnet/cordova-universal-links-plugin/issues/24). Now you can define iOS Team ID as plugin preference. It will be used for generation of `apple-app-site-association` files.
58
- - [Issue #25](https://github.com/nordnet/cordova-universal-links-plugin/issues/25). Plugin now compatible with Cordova iOS platform v4.0.0.
59
-
60
- **Docs:**
61
-
62
- - Added `Migrating from previous versions` section.
63
- - Updated `Cordova config preferences` section.
64
- - Updated `Application launch handling` section.
65
- - Other minor changes because of new release.
66
-
67
- ## 1.0.1 (2015-10-23)
68
-
69
- **Bug fixes:**
70
-
71
- - Android. Fixed [issue #9](https://github.com/nordnet/cordova-universal-links-plugin/issues/9). Now when application is resumed from the link click - appropriate event is dispatched to the JavaScript side.
72
-
73
- **Enhancements:**
74
-
75
- - iOS. [Issue #6](https://github.com/nordnet/cordova-universal-links-plugin/issues/6). Scheme is now removed from the url matching process, since it is not needed: only hostname and path are used.
76
- - Merged [pull request #1](https://github.com/nordnet/cordova-universal-links-plugin/pull/1). Now dependency npm packages are taken from the package.json file. Thanks to [@dpa99c](https://github.com/dpa99c).
77
-
78
- **Docs:**
79
-
80
- - Added `Useful notes on Universal Links for iOS` section.
81
- - Updated `Android web integration` section. Added more information about web integration process.
82
- - Added some additional links on the Android documentation.
83
- - Fixed some broken links inside the docs.
84
- - Added CHANGELOG.md file.