pushwoosh-cordova-plugin 8.3.52 → 8.3.54

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
@@ -14,13 +14,13 @@ Cross-Platform push notifications by Pushwoosh for Cordova / PhoneGap
14
14
  Using npm:
15
15
 
16
16
  ```
17
- cordova plugin add pushwoosh-cordova-plugin@8.3.52
17
+ cordova plugin add pushwoosh-cordova-plugin@8.3.54
18
18
  ```
19
19
 
20
20
  Using git:
21
21
 
22
22
  ```
23
- cordova plugin add https://github.com/Pushwoosh/pushwoosh-phonegap-plugin.git#8.3.52
23
+ cordova plugin add https://github.com/Pushwoosh/pushwoosh-phonegap-plugin.git#8.3.54
24
24
  ```
25
25
 
26
26
  ### Guide
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pushwoosh-cordova-plugin",
3
- "version": "8.3.52",
3
+ "version": "8.3.54",
4
4
  "description": "\n This plugin allows you to send and receive push notifications. Powered by Pushwoosh (www.pushwoosh.com).\n ",
5
5
  "main":"www/PushNotification.js",
6
6
  "typings":"types/index.d.ts",
package/plugin.xml CHANGED
@@ -1,5 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android" id="pushwoosh-cordova-plugin" version="8.3.52">
2
+ <plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android" id="pushwoosh-cordova-plugin" version="8.3.54">
3
3
 
4
4
  <name>Pushwoosh</name>
5
5
 
@@ -95,13 +95,13 @@
95
95
  <framework src="org.jetbrains.kotlin:kotlin-stdlib:1.1.60" />
96
96
  <framework src="com.google.android.material:material:1.12.0"/>
97
97
 
98
- <framework src="com.pushwoosh:pushwoosh:6.7.45"/>
99
- <framework src="com.pushwoosh:pushwoosh-amazon:6.7.45"/>
100
- <framework src="com.pushwoosh:pushwoosh-firebase:6.7.45"/>
101
- <framework src="com.pushwoosh:pushwoosh-badge:6.7.45"/>
102
- <framework src="com.pushwoosh:pushwoosh-inbox:6.7.45"/>
103
- <framework src="com.pushwoosh:pushwoosh-inbox-ui:6.7.45"/>
104
- <framework src="com.pushwoosh:pushwoosh-huawei:6.7.45"/>
98
+ <framework src="com.pushwoosh:pushwoosh:6.7.46"/>
99
+ <framework src="com.pushwoosh:pushwoosh-amazon:6.7.46"/>
100
+ <framework src="com.pushwoosh:pushwoosh-firebase:6.7.46"/>
101
+ <framework src="com.pushwoosh:pushwoosh-badge:6.7.46"/>
102
+ <framework src="com.pushwoosh:pushwoosh-inbox:6.7.46"/>
103
+ <framework src="com.pushwoosh:pushwoosh-inbox-ui:6.7.46"/>
104
+ <framework src="com.pushwoosh:pushwoosh-huawei:6.7.46"/>
105
105
  </platform>
106
106
 
107
107
  <!-- ios -->
@@ -143,8 +143,8 @@
143
143
  <source url="https://github.com/CocoaPods/Specs.git"/>
144
144
  </config>
145
145
  <pods use-frameworks="true">
146
- <pod name="PushwooshXCFramework" spec="7.0.2" />
147
- <pod name="PushwooshInboxUIXCFramework" spec="7.0.2" />
146
+ <pod name="PushwooshXCFramework" spec="7.0.3" />
147
+ <pod name="PushwooshInboxUIXCFramework" spec="7.0.3" />
148
148
  </pods>
149
149
  </podspec>
150
150
 
@@ -16,7 +16,7 @@ def callsSrc = pluginDir ? new File(pluginDir, 'src/android/src/com/pushwoosh/pl
16
16
  def applyVoip = {
17
17
  if (voipEnabled) {
18
18
  println "[${pluginId}] PW_VOIP_ANDROID_ENABLED=true — enabling VoIP (dependency + sources)"
19
- dependencies { implementation "com.pushwoosh:pushwoosh-calls:6.7.45" }
19
+ dependencies { implementation "com.pushwoosh:pushwoosh-calls:6.7.46" }
20
20
  if (callsSrc?.exists()) {
21
21
  android.sourceSets.main.java.srcDirs += callsSrc
22
22
  println "[${pluginId}] Added optional sources: ${callsSrc}"
@@ -1330,16 +1330,40 @@ void pwplugin_didRegisterWithDeviceToken(id self, SEL _cmd, id application, NSDa
1330
1330
  if ([self respondsToSelector:@selector(application: pwplugin_didRegisterWithDeviceToken:)]) {
1331
1331
  [self application:application pwplugin_didRegisterWithDeviceToken:deviceToken];
1332
1332
  }
1333
-
1333
+
1334
1334
  [[Pushwoosh sharedInstance] handlePushRegistration:deviceToken];
1335
+
1336
+ PushNotification *pushHandler = pw_PushNotificationPlugin;
1337
+ if (pushHandler && pushHandler.callbackIds[@"registerDevice"]) {
1338
+ const unsigned char *tokenBytes = (const unsigned char *)[deviceToken bytes];
1339
+ NSMutableString *token = [NSMutableString string];
1340
+ for (NSInteger i = 0; i < [deviceToken length]; i++) {
1341
+ [token appendFormat:@"%02x", (unsigned int)tokenBytes[i]];
1342
+ }
1343
+
1344
+ NSMutableDictionary *results = [PushNotificationManager getRemoteNotificationStatus];
1345
+ results[@"pushToken"] = token;
1346
+ CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:results];
1347
+ [pushHandler.commandDelegate sendPluginResult:pluginResult callbackId:pushHandler.callbackIds[@"registerDevice"]];
1348
+ pushHandler.callbackIds[@"registerDevice"] = nil;
1349
+ }
1335
1350
  }
1336
1351
 
1337
1352
  void pwplugin_didFailToRegisterForRemoteNotificationsWithError(id self, SEL _cmd, UIApplication *application, NSError *error) {
1338
1353
  if ([self respondsToSelector:@selector(application:pwplugin_didFailToRegisterForRemoteNotificationsWithError:)]) {
1339
1354
  [self application:application pwplugin_didFailToRegisterForRemoteNotificationsWithError:error];
1340
1355
  }
1341
-
1356
+
1342
1357
  [[Pushwoosh sharedInstance] handlePushRegistrationFailure:error];
1358
+
1359
+ PushNotification *pushHandler = pw_PushNotificationPlugin;
1360
+ if (pushHandler && pushHandler.callbackIds[@"registerDevice"]) {
1361
+ NSMutableDictionary *results = [NSMutableDictionary dictionary];
1362
+ results[@"error"] = [NSString stringWithFormat:@"%@", error];
1363
+ CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:results];
1364
+ [pushHandler.commandDelegate sendPluginResult:pluginResult callbackId:pushHandler.callbackIds[@"registerDevice"]];
1365
+ pushHandler.callbackIds[@"registerDevice"] = nil;
1366
+ }
1343
1367
  }
1344
1368
 
1345
1369
  BOOL pwplugin_didRegisterUserNotificationSettings(id self, SEL _cmd, id application, id notificationSettings) {