cordova-plugin-appice 2.0.7 → 2.0.8
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 -129
- package/scripts/BeforeAndroidBuilt.js +126 -112
- 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 -5
- 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 +191 -259
- package/src/ios/AppICEPlugin.h +90 -90
- package/src/ios/AppICEPlugin.m +1062 -1087
- 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,259 +1,191 @@
|
|
|
1
|
-
|
|
2
|
-
#import "
|
|
3
|
-
#import
|
|
4
|
-
#import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
@
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
#define
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
192
|
-
}
|
|
193
|
-
#endif
|
|
194
|
-
|
|
195
|
-
#pragma mark - Handle Notification Action
|
|
196
|
-
|
|
197
|
-
- (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forLocalNotification:(UILocalNotification *)notification completionHandler:(void(^)())completionHandler {
|
|
198
|
-
|
|
199
|
-
@try {
|
|
200
|
-
[[AppICEPlugin appice] onHandleActionForIdentifier:identifier];
|
|
201
|
-
|
|
202
|
-
if (completionHandler) {
|
|
203
|
-
completionHandler();
|
|
204
|
-
}
|
|
205
|
-
} @catch (NSException *exception) {
|
|
206
|
-
|
|
207
|
-
} @finally {
|
|
208
|
-
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
- (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo completionHandler:(void (^)())completionHandler
|
|
213
|
-
{
|
|
214
|
-
@try {
|
|
215
|
-
[[AppICEPlugin appice] onHandleActionForIdentifier:identifier];
|
|
216
|
-
|
|
217
|
-
if (completionHandler) {
|
|
218
|
-
completionHandler();
|
|
219
|
-
}
|
|
220
|
-
} @catch (NSException *exception) {
|
|
221
|
-
|
|
222
|
-
} @finally {
|
|
223
|
-
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
#pragma mark - OpenURL Functions
|
|
228
|
-
|
|
229
|
-
- (BOOL)application:(UIApplication*)application openURL:(NSURL*)url sourceApplication:(NSString*)sourceApplication annotation:(id)annotation {
|
|
230
|
-
@try {
|
|
231
|
-
if (!url) {
|
|
232
|
-
return NO;
|
|
233
|
-
}
|
|
234
|
-
[[AppICEPlugin appice] onHandleOpenURLNotification:url];
|
|
235
|
-
} @catch (NSException *exception) {
|
|
236
|
-
}
|
|
237
|
-
return YES;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options {
|
|
241
|
-
@try {
|
|
242
|
-
if (!url) {
|
|
243
|
-
return NO;
|
|
244
|
-
}
|
|
245
|
-
[[AppICEPlugin appice] onHandleOpenURLNotification:url];
|
|
246
|
-
|
|
247
|
-
} @catch (NSException *exception) {
|
|
248
|
-
}
|
|
249
|
-
return YES;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
- (void)openURL:(NSURL*)url options:(NSDictionary<NSString *, id> *)options completionHandler:(void (^ __nullable)(BOOL success))completion {
|
|
253
|
-
@try {
|
|
254
|
-
[[AppICEPlugin appice] onHandleOpenURLNotification:url];
|
|
255
|
-
} @catch (NSException *exception) {
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
@end
|
|
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
|
+
#endif
|
|
13
|
+
|
|
14
|
+
#if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
|
|
15
|
+
@interface AppDelegate () <UNUserNotificationCenterDelegate>
|
|
16
|
+
@end
|
|
17
|
+
#endif
|
|
18
|
+
|
|
19
|
+
#define kApplicationInBackgroundKey @"applicationInBackground"
|
|
20
|
+
#define SYSTEM_VERSION_GRATERTHAN_OR_EQUALTO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
|
|
21
|
+
|
|
22
|
+
@implementation AppDelegate (AppICEPlugin)
|
|
23
|
+
|
|
24
|
+
static id appdelegate;
|
|
25
|
+
typedef void (*OriginalImpType)(id self, SEL selector);
|
|
26
|
+
static OriginalImpType originalImp;
|
|
27
|
+
+ (void)load {
|
|
28
|
+
|
|
29
|
+
NSLog(@"In Appice Load method");
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
- (id)init
|
|
34
|
+
{
|
|
35
|
+
self = [super init];
|
|
36
|
+
|
|
37
|
+
NSLog(@"Appice+delegate init");
|
|
38
|
+
UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
|
|
39
|
+
center.delegate = self;
|
|
40
|
+
return self;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
- (void)setApplicationInBackground:(NSNumber *)applicationInBackground {
|
|
44
|
+
objc_setAssociatedObject(self, kApplicationInBackgroundKey, applicationInBackground, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
- (NSNumber *)applicationInBackground {
|
|
48
|
+
return objc_getAssociatedObject(self, kApplicationInBackgroundKey);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
#pragma mark - Register Remote Notification
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
- (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
|
|
56
|
+
{
|
|
57
|
+
// swizzle method called
|
|
58
|
+
@try {
|
|
59
|
+
[[AppICEPlugin appice] handleToken:deviceToken];
|
|
60
|
+
NSLog(@"inside didRegisterForRemoteNotificationsWithDeviceToken %@",deviceToken);
|
|
61
|
+
} @catch (NSException *exception) {
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
#pragma mark - Handle Notification info
|
|
65
|
+
|
|
66
|
+
- (void) application:(UIApplication*)application didReceiveLocalNotification:(UILocalNotification*)notification {
|
|
67
|
+
|
|
68
|
+
@try {
|
|
69
|
+
NSLog(@"inside didReceiveLocalNotification");
|
|
70
|
+
} @catch (NSException *exception) {
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
|
|
75
|
+
{
|
|
76
|
+
@try {
|
|
77
|
+
BOOL appIceServer = [[appICE sharedInstance] isAppICENotification:userInfo];
|
|
78
|
+
if(appIceServer)
|
|
79
|
+
{
|
|
80
|
+
// if yes appice plugin will be notified
|
|
81
|
+
[[AppICEPlugin appice] onHandleRemoteUNotification:userInfo];
|
|
82
|
+
completionHandler(UIBackgroundFetchResultNewData);
|
|
83
|
+
}
|
|
84
|
+
NSLog(@"inside didrecieveremotenotification %@",userInfo);
|
|
85
|
+
} @catch (NSException *exception) {
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
#if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
|
|
92
|
+
- (void)userNotificationCenter:(UNUserNotificationCenter *)center
|
|
93
|
+
willPresentNotification:(UNNotification *)notification
|
|
94
|
+
withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler {
|
|
95
|
+
@try {
|
|
96
|
+
|
|
97
|
+
completionHandler(UNNotificationPresentationOptionAlert | UNNotificationPresentationOptionBadge | UNNotificationPresentationOptionSound);
|
|
98
|
+
} @catch (NSException *exception) {
|
|
99
|
+
|
|
100
|
+
} @finally {
|
|
101
|
+
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
- (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void(^)(void))completionHandler{
|
|
106
|
+
|
|
107
|
+
@try {
|
|
108
|
+
|
|
109
|
+
NSDictionary *userInfo = response.notification.request.content.userInfo;
|
|
110
|
+
NSLog(@"inside didReceiveNotificationResponse %@",userInfo);
|
|
111
|
+
BOOL appIceServer = [[appICE sharedInstance] isAppICENotification:userInfo];
|
|
112
|
+
if(appIceServer)
|
|
113
|
+
{
|
|
114
|
+
[[AppICEPlugin appice] onHandleNotificationUResponse:userInfo];
|
|
115
|
+
|
|
116
|
+
}
|
|
117
|
+
completionHandler();
|
|
118
|
+
} @catch (NSException *exception) {
|
|
119
|
+
|
|
120
|
+
} @finally {
|
|
121
|
+
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
#endif
|
|
125
|
+
|
|
126
|
+
#pragma mark - Handle Notification Action
|
|
127
|
+
|
|
128
|
+
- (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forLocalNotification:(UILocalNotification *)notification completionHandler:(void(^)())completionHandler {
|
|
129
|
+
|
|
130
|
+
@try {
|
|
131
|
+
[[AppICEPlugin appice] onHandleActionForIdentifier:identifier];
|
|
132
|
+
|
|
133
|
+
if (completionHandler) {
|
|
134
|
+
completionHandler();
|
|
135
|
+
}
|
|
136
|
+
} @catch (NSException *exception) {
|
|
137
|
+
|
|
138
|
+
} @finally {
|
|
139
|
+
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
- (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo completionHandler:(void (^)())completionHandler
|
|
144
|
+
{
|
|
145
|
+
@try {
|
|
146
|
+
[[AppICEPlugin appice] onHandleActionForIdentifier:identifier];
|
|
147
|
+
|
|
148
|
+
if (completionHandler) {
|
|
149
|
+
completionHandler();
|
|
150
|
+
}
|
|
151
|
+
} @catch (NSException *exception) {
|
|
152
|
+
|
|
153
|
+
} @finally {
|
|
154
|
+
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
#pragma mark - OpenURL Functions
|
|
159
|
+
|
|
160
|
+
- (BOOL)application:(UIApplication*)application openURL:(NSURL*)url sourceApplication:(NSString*)sourceApplication annotation:(id)annotation {
|
|
161
|
+
@try {
|
|
162
|
+
if (!url) {
|
|
163
|
+
return NO;
|
|
164
|
+
}
|
|
165
|
+
[[AppICEPlugin appice] onHandleOpenURLNotification:url];
|
|
166
|
+
} @catch (NSException *exception) {
|
|
167
|
+
}
|
|
168
|
+
return YES;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options {
|
|
172
|
+
@try {
|
|
173
|
+
if (!url) {
|
|
174
|
+
return NO;
|
|
175
|
+
}
|
|
176
|
+
[[AppICEPlugin appice] onHandleOpenURLNotification:url];
|
|
177
|
+
|
|
178
|
+
} @catch (NSException *exception) {
|
|
179
|
+
}
|
|
180
|
+
return YES;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
- (void)openURL:(NSURL*)url options:(NSDictionary<NSString *, id> *)options completionHandler:(void (^ __nullable)(BOOL success))completion {
|
|
184
|
+
@try {
|
|
185
|
+
[[AppICEPlugin appice] onHandleOpenURLNotification:url];
|
|
186
|
+
} @catch (NSException *exception) {
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
@end
|
|
191
|
+
|