cordova-plugin-appice 2.2.2 → 2.2.4
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/package.json
CHANGED
package/plugin.xml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
|
3
|
-
id="cordova-plugin-appice" version="2.2.
|
|
3
|
+
id="cordova-plugin-appice" version="2.2.4">
|
|
4
4
|
<name>AppICE</name>
|
|
5
5
|
<description>AppICE Plugin for Cordova/PhoneGap</description>
|
|
6
6
|
<license>Commercial</license>
|
|
@@ -114,8 +114,14 @@
|
|
|
114
114
|
<!-- WORK MANAGER VERSION-->
|
|
115
115
|
<preference name="WORK_MANAGER_VERSION" default="2.7.1"/>
|
|
116
116
|
|
|
117
|
+
<!--MEDIA3 EXOPLAYER VERSION-->
|
|
118
|
+
<preference name="MEDIA3_EXOPLAYER_VERSION" default="1.0.2"/>
|
|
119
|
+
|
|
120
|
+
<!--MEDIA3 UI VERSION-->
|
|
121
|
+
<preference name="MEDIA3_UI_VERSION" default="1.0.2"/>
|
|
122
|
+
|
|
117
123
|
<!-- AppICE VERSION-->
|
|
118
|
-
<preference name="APPICE_VERSION" default="2.5.
|
|
124
|
+
<preference name="APPICE_VERSION" default="2.5.96"/>
|
|
119
125
|
|
|
120
126
|
|
|
121
127
|
<!-- USES PERMISSION -->
|
|
@@ -194,6 +200,8 @@
|
|
|
194
200
|
<framework src= "androidx.concurrent:concurrent-futures:$ANDROIDX_CONCURRENT_FUTURE_VERSION"/>
|
|
195
201
|
<framework src= "androidx.lifecycle:lifecycle-runtime:$ANDROIDX_LIFECYCLE_SDK_VERSION"/>
|
|
196
202
|
<framework src= "androidx.lifecycle:lifecycle-extensions:$ANDROIDX_LIFECYCLE_EXTENTION_VERSION"/>
|
|
203
|
+
<framework src= "androidx.media3:media3-exoplayer:$MEDIA3_EXOPLAYER_VERSION"/>
|
|
204
|
+
<framework src= "androidx.media3:media3-ui:$MEDIA3_UI_VERSION"/>
|
|
197
205
|
<framework src= "appice.io.android:sdk:$APPICE_VERSION"/>
|
|
198
206
|
|
|
199
207
|
<!-- SCRIPT PATH -->
|
|
@@ -19,6 +19,7 @@ import com.google.firebase.messaging.RemoteMessage;
|
|
|
19
19
|
import java.util.Map;
|
|
20
20
|
|
|
21
21
|
import semusi.activitysdk.ContextSdk;
|
|
22
|
+
import semusi.context.utility.Utility;
|
|
22
23
|
|
|
23
24
|
/* import path for MainActivity */
|
|
24
25
|
|
|
@@ -44,8 +45,9 @@ public class AppICEPushHandler {
|
|
|
44
45
|
Map<String, String> data = message.getData();
|
|
45
46
|
|
|
46
47
|
if (isAppICEPush(message) ) {
|
|
48
|
+
String messageContent = data.get("message");
|
|
47
49
|
System.out.println("data coming "+message.getData());
|
|
48
|
-
ContextSdk.handleAppICEPush(
|
|
50
|
+
ContextSdk.handleAppICEPush(messageContent, createPendingIntent(data.get(MESSAGE), context), deletePendingIntent(context), context, null, Utility.next());
|
|
49
51
|
}
|
|
50
52
|
}
|
|
51
53
|
|
|
@@ -159,4 +161,4 @@ public class AppICEPushHandler {
|
|
|
159
161
|
System.out.println("handleLandingPage check if any error with intent "+e);
|
|
160
162
|
}
|
|
161
163
|
}
|
|
162
|
-
}
|
|
164
|
+
}
|
|
@@ -257,6 +257,9 @@ static OriginalImpType originalImp;
|
|
|
257
257
|
- (void)swizzled_application:(UIApplication*)application swizzleddidRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken {
|
|
258
258
|
@try {
|
|
259
259
|
NSLog(@"apns token appIce %@",deviceToken);
|
|
260
|
+
|
|
261
|
+
[[NSNotificationCenter defaultCenter] postNotificationName:@"didRegisterForRemoteNotificationsWithDeviceToken" object:self userInfo:@{@"deviceToken":deviceToken}];
|
|
262
|
+
|
|
260
263
|
[[AppICEPlugin appice] handleToken:deviceToken];
|
|
261
264
|
if(originalMethodRemoteNotificationsWithDeviceToken){
|
|
262
265
|
//caling original method over swizzling ie other plugin push method
|
package/src/ios/AppICEPlugin.m
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
//#import "SBJson.h"
|
|
13
13
|
//#import "ASIHTTPRequest.h"
|
|
14
|
-
|
|
14
|
+
static NSString * const DidRegisterForRemoteNotificationsWithDeviceToken = @"didRegisterForRemoteNotificationsWithDeviceToken";
|
|
15
15
|
NSString *baseUrl;
|
|
16
16
|
NSString *postData;
|
|
17
17
|
HttpSuccessBlock successBlock;
|
|
@@ -44,6 +44,8 @@ static NSDictionary *pendingDeeplink = nil;
|
|
|
44
44
|
// Listen for UIApplicationDidFinishLaunchingNotification to get a hold of launchOptions
|
|
45
45
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onDidFinishLaunchingNotification:) name:UIApplicationDidFinishLaunchingNotification object:nil];
|
|
46
46
|
|
|
47
|
+
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleTokenPush:) name:DidRegisterForRemoteNotificationsWithDeviceToken object:nil];
|
|
48
|
+
|
|
47
49
|
} @catch (NSException *exception) {
|
|
48
50
|
}
|
|
49
51
|
}
|
|
@@ -66,7 +68,31 @@ static NSDictionary *pendingDeeplink = nil;
|
|
|
66
68
|
} @catch (NSException *exception) {
|
|
67
69
|
}
|
|
68
70
|
}
|
|
69
|
-
|
|
71
|
+
+(void)handleTokenPush:(NSNotification *)deviceToken {
|
|
72
|
+
@try {
|
|
73
|
+
NSLog(@"In handleTokenPush");
|
|
74
|
+
// Fetch device token from dictionary
|
|
75
|
+
|
|
76
|
+
NSDictionary *userInfoDict = deviceToken.userInfo;
|
|
77
|
+
NSData *storedDeviceToken = userInfoDict[@"deviceToken"];
|
|
78
|
+
NSLog(@"Apns token from post : %@", storedDeviceToken);
|
|
79
|
+
// Verify that the fetched object is of NSData type
|
|
80
|
+
|
|
81
|
+
if ([storedDeviceToken isKindOfClass:[NSData class]]) {
|
|
82
|
+
|
|
83
|
+
// Use the device token
|
|
84
|
+
|
|
85
|
+
NSLog(@"Device Token: %@", storedDeviceToken);
|
|
86
|
+
[appICE setTokenInPushNotification:storedDeviceToken];
|
|
87
|
+
|
|
88
|
+
} else {
|
|
89
|
+
|
|
90
|
+
NSLog(@"Error: Device token not found or is not of NSData type.");
|
|
91
|
+
|
|
92
|
+
}
|
|
93
|
+
} @catch (NSException *exception) {
|
|
94
|
+
}
|
|
95
|
+
}
|
|
70
96
|
-(void)handleTokenError:(NSError *)error {
|
|
71
97
|
@try {
|
|
72
98
|
NSLog(@"Apns token Error : %@", error.description);
|