cordova-plugin-appice 2.0.8 → 2.0.9
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 +122 -122
- package/example/config.xml +59 -59
- package/example/package.json +38 -38
- package/example/res/ai_android.pem +40 -40
- package/example/www/css/index.css +116 -116
- package/example/www/index.html +62 -62
- package/example/www/js/index.js +102 -102
- package/libcordova/android-release-aar.gradle +62 -62
- package/libcordova/build.gradle +50 -50
- package/libcordova/proguard-rules.pro +21 -21
- package/libcordova/src/main/AndroidManifest.xml +24 -24
- package/libcordova/src/main/java/com/appice/cordova/AppICEPlugin.java +968 -968
- package/libcordova/src/main/java/com/appice/cordova/CampaignCampsReceiver.java +95 -95
- package/libcordova/src/main/java/com/appice/cordova/NotificationEventService.java +55 -55
- package/libcordova/src/main/res/values/strings.xml +3 -3
- package/package.json +26 -26
- package/plugin.xml +128 -128
- package/scripts/BeforeAndroidBuilt.js +125 -125
- package/scripts/BeforeIosBuilt.js +38 -38
- package/scripts/androidAfterPluginAdd.js +159 -159
- package/scripts/androidAfterPluginRm.js +195 -195
- package/scripts/iOSAfterPluginAdd.js +98 -98
- package/scripts/iOSAfterPluginRm.js +74 -74
- package/src/build.gradle +14 -14
- package/src/firebase/modified/android/FirebasePluginMessagingService.java +356 -356
- package/src/firebase/modified/ios/AppDelegate+FirebasePlugin.m +529 -529
- package/src/firebase/modified/modified.iml +10 -10
- package/src/firebase/original/android/FirebasePluginMessagingService.java +348 -348
- package/src/firebase/original/ios/AppDelegate+FirebasePlugin.m +519 -519
- package/src/firebase/original/original.iml +10 -10
- package/src/ios/AppDelegate+AppICEPlugin.h +8 -8
- package/src/ios/AppDelegate+AppICEPlugin.m +279 -191
- package/src/ios/AppICEPlugin.h +90 -90
- package/src/ios/AppICEPlugin.m +1062 -1062
- package/www/AppICE.js +283 -283
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<module type="JAVA_MODULE" version="4">
|
|
3
|
-
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
4
|
-
<exclude-output />
|
|
5
|
-
<content url="file://$MODULE_DIR$">
|
|
6
|
-
<sourceFolder url="file://$MODULE_DIR$/android" isTestSource="false" packagePrefix="org.apache.cordova.firebase" />
|
|
7
|
-
</content>
|
|
8
|
-
<orderEntry type="inheritedJdk" />
|
|
9
|
-
<orderEntry type="sourceFolder" forTests="false" />
|
|
10
|
-
</component>
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module type="JAVA_MODULE" version="4">
|
|
3
|
+
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
4
|
+
<exclude-output />
|
|
5
|
+
<content url="file://$MODULE_DIR$">
|
|
6
|
+
<sourceFolder url="file://$MODULE_DIR$/android" isTestSource="false" packagePrefix="org.apache.cordova.firebase" />
|
|
7
|
+
</content>
|
|
8
|
+
<orderEntry type="inheritedJdk" />
|
|
9
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
10
|
+
</component>
|
|
11
11
|
</module>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
#import "AppDelegate.h"
|
|
3
|
-
|
|
4
|
-
@interface AppDelegate (AppICEPlugin)
|
|
5
|
-
|
|
6
|
-
+(id) delegate;
|
|
7
|
-
|
|
8
|
-
@end
|
|
1
|
+
|
|
2
|
+
#import "AppDelegate.h"
|
|
3
|
+
|
|
4
|
+
@interface AppDelegate (AppICEPlugin)
|
|
5
|
+
|
|
6
|
+
+(id) delegate;
|
|
7
|
+
|
|
8
|
+
@end
|
|
@@ -1,191 +1,279 @@
|
|
|
1
|
-
#import "AppDelegate+AppICEPlugin.h"
|
|
2
|
-
#import "AppICEPlugin.h"
|
|
3
|
-
#import <objc/runtime.h>
|
|
4
|
-
#import "appICE.h"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
#if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
|
|
11
|
-
@import UserNotifications;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
#
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
static
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
NSDictionary *userInfo = response.notification.request.content.userInfo;
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
{
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
} @catch (NSException *exception) {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
@
|
|
191
|
-
|
|
1
|
+
#import "AppDelegate+AppICEPlugin.h"
|
|
2
|
+
#import "AppICEPlugin.h"
|
|
3
|
+
#import <objc/runtime.h>
|
|
4
|
+
#import "appICE.h"
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
#if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
|
|
11
|
+
@import UserNotifications;
|
|
12
|
+
|
|
13
|
+
@interface AppDelegate () <UNUserNotificationCenterDelegate>
|
|
14
|
+
@end
|
|
15
|
+
#endif
|
|
16
|
+
|
|
17
|
+
#define kApplicationInBackgroundKey @"applicationInBackground"
|
|
18
|
+
#define SYSTEM_VERSION_GRATERTHAN_OR_EQUALTO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
|
|
19
|
+
|
|
20
|
+
@implementation AppDelegate (AppICEPlugin)
|
|
21
|
+
|
|
22
|
+
static id appdelegate;
|
|
23
|
+
typedef void (*OriginalImpType)(id self, SEL selector);
|
|
24
|
+
static OriginalImpType originalImp;
|
|
25
|
+
+ (void)load {
|
|
26
|
+
|
|
27
|
+
NSLog(@"In Appice Load method");
|
|
28
|
+
|
|
29
|
+
// Swizzling method for handling received remote notifications
|
|
30
|
+
Method originalDidReceiveRemoteNotification = class_getInstanceMethod(self, @selector(application:didReceiveRemoteNotification:fetchCompletionHandler:));
|
|
31
|
+
Method swizzleDidReceiveRemoteNotification = class_getInstanceMethod(self, @selector(application:swizzleddidReceiveRemoteNotification:fetchCompletionHandler:));
|
|
32
|
+
method_exchangeImplementations(originalDidReceiveRemoteNotification, swizzleDidReceiveRemoteNotification);
|
|
33
|
+
|
|
34
|
+
// Swizzling method for handling notification responses
|
|
35
|
+
Method originalDidResponseRemoteNotification = class_getInstanceMethod(self, @selector(userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:));
|
|
36
|
+
Method swizzleDidResponseRemoteNotification = class_getInstanceMethod(self, @selector(userNotificationCenter:swizzleddidReceiveNotificationResponse:withCompletionHandler:));
|
|
37
|
+
method_exchangeImplementations(originalDidResponseRemoteNotification, swizzleDidResponseRemoteNotification);
|
|
38
|
+
|
|
39
|
+
// Swizzling method for handling notification will present
|
|
40
|
+
Method originalwillPresentNotification = class_getInstanceMethod(self, @selector(userNotificationCenter:willPresentNotification:withCompletionHandler:));
|
|
41
|
+
Method swizzlewillPresentNotification = class_getInstanceMethod(self, @selector(userNotificationCenter:swizzledwillPresentNotification:withCompletionHandler:));
|
|
42
|
+
method_exchangeImplementations(originalwillPresentNotification, swizzlewillPresentNotification);
|
|
43
|
+
|
|
44
|
+
// Swizzling method for handling device token registration for remote notifications
|
|
45
|
+
Method originaldidRegisterForRemoteNotificationsWithDeviceToken = class_getInstanceMethod(self, @selector(application:didRegisterForRemoteNotificationsWithDeviceToken:));
|
|
46
|
+
Method swizzleddidRegisterForRemoteNotificationsWithDeviceToken = class_getInstanceMethod(self, @selector(application:swizzleddidRegisterForRemoteNotificationsWithDeviceToken:));
|
|
47
|
+
method_exchangeImplementations(originaldidRegisterForRemoteNotificationsWithDeviceToken, swizzleddidRegisterForRemoteNotificationsWithDeviceToken);
|
|
48
|
+
|
|
49
|
+
// Swizzling method for handling failures during remote notification registration
|
|
50
|
+
Method originaldidFailToRegisterForRemoteNotificationsWithError = class_getInstanceMethod(self, @selector(application:didFailToRegisterForRemoteNotificationsWithError:));
|
|
51
|
+
Method swizzleddidFailToRegisterForRemoteNotificationsWithError = class_getInstanceMethod(self, @selector(application:swizzleddidFailToRegisterForRemoteNotificationsWithError:));
|
|
52
|
+
method_exchangeImplementations(originaldidFailToRegisterForRemoteNotificationsWithError, swizzleddidFailToRegisterForRemoteNotificationsWithError);
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
- (id)init {
|
|
58
|
+
self = [super init];
|
|
59
|
+
|
|
60
|
+
NSLog(@"Appice+delegate init");
|
|
61
|
+
|
|
62
|
+
// Set the current instance as the delegate for UNUserNotificationCenter.
|
|
63
|
+
UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
|
|
64
|
+
center.delegate = self;
|
|
65
|
+
|
|
66
|
+
return self;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
- (void)setApplicationInBackground:(NSNumber *)applicationInBackground {
|
|
70
|
+
objc_setAssociatedObject(self, kApplicationInBackgroundKey, applicationInBackground, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
- (NSNumber *)applicationInBackground {
|
|
74
|
+
return objc_getAssociatedObject(self, kApplicationInBackgroundKey);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
#pragma mark - Handling received remote notifications
|
|
78
|
+
|
|
79
|
+
// Swizzled method for handling received remote notifications
|
|
80
|
+
- (void)application:(UIApplication *)application swizzleddidReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
|
|
81
|
+
NSLog(@"inside swizzledidreceive %@", userInfo);
|
|
82
|
+
@try {
|
|
83
|
+
// Check if the push is from Appice server.
|
|
84
|
+
BOOL appIceServer = [[appICE sharedInstance] isAppICENotification:userInfo];
|
|
85
|
+
if (appIceServer) {
|
|
86
|
+
// If yes, Appice plugin will be notified.
|
|
87
|
+
[[AppICEPlugin appice] onHandleRemoteUNotification:userInfo];
|
|
88
|
+
completionHandler(UIBackgroundFetchResultNewData);
|
|
89
|
+
} else {
|
|
90
|
+
// Else, the notification is not related to Appice, so it will be handled by other third-party plugin.
|
|
91
|
+
[self application:application swizzleddidReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
@catch (NSException *exception) {
|
|
95
|
+
NSLog(@"exception from did receive notification cordova = %@", exception.reason);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
-(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
|
|
100
|
+
NSLog(@"inside original didReceiveRemoteNotification %@",userInfo);
|
|
101
|
+
completionHandler(UIBackgroundFetchResultNewData);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
#pragma mark - Handling of remote notification response
|
|
105
|
+
// Swizzled method for handling remote notification response
|
|
106
|
+
- (void)userNotificationCenter:(UNUserNotificationCenter *)center swizzleddidReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void(^)(void))completionHandler{
|
|
107
|
+
|
|
108
|
+
@try {
|
|
109
|
+
NSDictionary *userInfo = response.notification.request.content.userInfo;
|
|
110
|
+
NSLog(@"inside swizzledidresponse %@",userInfo);
|
|
111
|
+
BOOL appIceServer = [[appICE sharedInstance] isAppICENotification:userInfo];
|
|
112
|
+
if(appIceServer)
|
|
113
|
+
{
|
|
114
|
+
// If yes, Appice plugin will be notified.
|
|
115
|
+
[[AppICEPlugin appice] onHandleNotificationUResponse:userInfo];
|
|
116
|
+
completionHandler();
|
|
117
|
+
}
|
|
118
|
+
else
|
|
119
|
+
{
|
|
120
|
+
// Else, the notification is not related to Appice, so it will be handled by other third-party plugin.
|
|
121
|
+
[self userNotificationCenter:center swizzleddidReceiveNotificationResponse:response withCompletionHandler:completionHandler];
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
}
|
|
125
|
+
@catch (NSException *exception) {
|
|
126
|
+
NSLog(@"exception from did response notfication cordova = %@",exception.reason);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
- (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void(^)(void))completionHandler{
|
|
130
|
+
|
|
131
|
+
@try {
|
|
132
|
+
NSLog(@"In original userNotificationCenter");
|
|
133
|
+
}
|
|
134
|
+
@catch (NSException *exception) {
|
|
135
|
+
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
#pragma mark - Handling of remote notification registration failures
|
|
139
|
+
// Swizzled method for handling remote notification registration failures
|
|
140
|
+
- (void)application:(UIApplication*)application swizzleddidFailToRegisterForRemoteNotificationsWithError:(NSError*)error {
|
|
141
|
+
@try {
|
|
142
|
+
[[AppICEPlugin appice] handleTokenError:error];
|
|
143
|
+
[self application:application swizzleddidFailToRegisterForRemoteNotificationsWithError:error];
|
|
144
|
+
} @catch (NSException *exception) {
|
|
145
|
+
NSLog(@"exception from swizzleddidFailToRegisterForRemoteNotificationsWithError cordova = %@",exception.reason);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
- (void)application:(UIApplication*)application didFailToRegisterForRemoteNotificationsWithError:(NSError*)error {
|
|
149
|
+
@try {
|
|
150
|
+
NSLog(@"in original didFailToRegisterForRemoteNotificationsWithError");
|
|
151
|
+
} @catch (NSException *exception) {
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
#pragma mark - Handle Device Token
|
|
155
|
+
// Swizzled method for handling Device Token
|
|
156
|
+
- (void)application:(UIApplication*)application swizzleddidRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken {
|
|
157
|
+
@try {
|
|
158
|
+
NSLog(@"apns token appIce %@",deviceToken);
|
|
159
|
+
[[AppICEPlugin appice] handleToken:deviceToken];
|
|
160
|
+
[self application:application swizzleddidRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
|
|
161
|
+
|
|
162
|
+
} @catch(NSException *e){
|
|
163
|
+
NSLog(@"exception from swizzleddidRegisterForRemoteNotificationsWithDeviceToken cordova = %@",e.reason);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
- (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
|
|
167
|
+
{
|
|
168
|
+
@try {
|
|
169
|
+
NSLog(@"inside didRegisterForRemoteNotificationsWithDeviceToken %@",deviceToken);
|
|
170
|
+
|
|
171
|
+
} @catch (NSException *exception) {
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
#pragma mark - Handle Local Notification
|
|
175
|
+
|
|
176
|
+
- (void) application:(UIApplication*)application didReceiveLocalNotification:(UILocalNotification*)notification {
|
|
177
|
+
|
|
178
|
+
@try {
|
|
179
|
+
NSLog(@"inside didReceiveLocalNotification");
|
|
180
|
+
} @catch (NSException *exception) {
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
#pragma mark - Handling of remote notification willPresentNotification
|
|
185
|
+
|
|
186
|
+
#if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
|
|
187
|
+
- (void)userNotificationCenter:(UNUserNotificationCenter *)center
|
|
188
|
+
willPresentNotification:(UNNotification *)notification
|
|
189
|
+
withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler {
|
|
190
|
+
@try {
|
|
191
|
+
NSLog(@"inside original willPresentNotification");
|
|
192
|
+
} @catch (NSException *exception) {
|
|
193
|
+
|
|
194
|
+
} @finally {
|
|
195
|
+
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
- (void)userNotificationCenter:(UNUserNotificationCenter *)center
|
|
200
|
+
swizzledwillPresentNotification:(UNNotification *)notification
|
|
201
|
+
withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler {
|
|
202
|
+
@try {
|
|
203
|
+
completionHandler(UNNotificationPresentationOptionAlert | UNNotificationPresentationOptionBadge | UNNotificationPresentationOptionSound);
|
|
204
|
+
} @catch (NSException *exception) {
|
|
205
|
+
NSLog(@"exception from willPresentNotification cordova = %@",exception.reason);
|
|
206
|
+
|
|
207
|
+
} @finally {
|
|
208
|
+
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
#endif
|
|
213
|
+
|
|
214
|
+
#pragma mark - Handle Notification Action
|
|
215
|
+
|
|
216
|
+
- (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forLocalNotification:(UILocalNotification *)notification completionHandler:(void(^)())completionHandler {
|
|
217
|
+
|
|
218
|
+
@try {
|
|
219
|
+
[[AppICEPlugin appice] onHandleActionForIdentifier:identifier];
|
|
220
|
+
|
|
221
|
+
if (completionHandler) {
|
|
222
|
+
completionHandler();
|
|
223
|
+
}
|
|
224
|
+
} @catch (NSException *exception) {
|
|
225
|
+
|
|
226
|
+
} @finally {
|
|
227
|
+
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
- (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo completionHandler:(void (^)())completionHandler
|
|
232
|
+
{
|
|
233
|
+
@try {
|
|
234
|
+
[[AppICEPlugin appice] onHandleActionForIdentifier:identifier];
|
|
235
|
+
|
|
236
|
+
if (completionHandler) {
|
|
237
|
+
completionHandler();
|
|
238
|
+
}
|
|
239
|
+
} @catch (NSException *exception) {
|
|
240
|
+
|
|
241
|
+
} @finally {
|
|
242
|
+
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
#pragma mark - OpenURL Functions
|
|
247
|
+
|
|
248
|
+
- (BOOL)application:(UIApplication*)application openURL:(NSURL*)url sourceApplication:(NSString*)sourceApplication annotation:(id)annotation {
|
|
249
|
+
@try {
|
|
250
|
+
if (!url) {
|
|
251
|
+
return NO;
|
|
252
|
+
}
|
|
253
|
+
[[AppICEPlugin appice] onHandleOpenURLNotification:url];
|
|
254
|
+
} @catch (NSException *exception) {
|
|
255
|
+
}
|
|
256
|
+
return YES;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options {
|
|
260
|
+
@try {
|
|
261
|
+
if (!url) {
|
|
262
|
+
return NO;
|
|
263
|
+
}
|
|
264
|
+
[[AppICEPlugin appice] onHandleOpenURLNotification:url];
|
|
265
|
+
|
|
266
|
+
} @catch (NSException *exception) {
|
|
267
|
+
}
|
|
268
|
+
return YES;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
- (void)openURL:(NSURL*)url options:(NSDictionary<NSString *, id> *)options completionHandler:(void (^ __nullable)(BOOL success))completion {
|
|
272
|
+
@try {
|
|
273
|
+
[[AppICEPlugin appice] onHandleOpenURLNotification:url];
|
|
274
|
+
} @catch (NSException *exception) {
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
@end
|
|
279
|
+
|