@thathoff/cordova-plugin-universal-links 0.3.7 → 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.
@@ -0,0 +1,11 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "WebSearch",
5
+ "WebFetch(domain:cordova.apache.org)",
6
+ "Bash(gh api:*)",
7
+ "WebFetch(domain:raw.githubusercontent.com)",
8
+ "WebFetch(domain:api.github.com)"
9
+ ]
10
+ }
11
+ }
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.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",
package/plugin.xml CHANGED
@@ -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