pushwoosh-react-native-plugin 6.1.8 → 6.1.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/index.js CHANGED
@@ -72,6 +72,17 @@ class PushNotification {
72
72
  PushwooshModule.clearLocalNotification();
73
73
  }
74
74
 
75
+ //Function: clearNotificationCenter
76
+ //Clears all existing and cancels all pending notifications
77
+ //
78
+ //Example:
79
+ //(start code)
80
+ // Pushwoosh.clearNotificationCenter();
81
+ //(end)
82
+ clearNotificationCenter(){
83
+ PushwooshModule.clearNotificationCenter();
84
+ }
85
+
75
86
  //Function: register
76
87
  //Call this to register for push notifications and retreive a push Token
77
88
  //
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pushwoosh-react-native-plugin",
3
- "version": "6.1.8",
3
+ "version": "6.1.9",
4
4
  "description": "This plugin allows you to send and receive push notifications. Powered by Pushwoosh (www.pushwoosh.com).",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |s|
2
2
  s.name = "pushwoosh-react-native-plugin"
3
- s.version = "6.1.8"
3
+ s.version = "6.1.9"
4
4
  s.summary = "React Native Pushwoosh Push Notifications module"
5
5
  s.requires_arc = true
6
6
  s.author = 'Pushwoosh'
@@ -38,7 +38,7 @@ android {
38
38
  }
39
39
 
40
40
  ext {
41
- pushwoosh = "6.3.4"
41
+ pushwoosh = "6.3.6"
42
42
  }
43
43
 
44
44
  evaluationDependsOn(':app')
@@ -281,6 +281,15 @@ public class PushwooshPlugin extends ReactContextBaseJavaModule implements Lifec
281
281
  LocalNotificationReceiver.cancelAll();
282
282
  }
283
283
 
284
+ @ReactMethod
285
+ public void clearNotificationCenter() {
286
+ if (AndroidPlatformModule.getManagerProvider() != null) {
287
+ if (AndroidPlatformModule.getManagerProvider().getNotificationManager() != null) {
288
+ AndroidPlatformModule.getManagerProvider().getNotificationManager().cancelAll();
289
+ }
290
+ }
291
+ }
292
+
284
293
  @ReactMethod
285
294
  public void setApplicationIconBadgeNumber(int badgeNumber) {
286
295
  PushwooshBadge.setBadgeNumber(badgeNumber);
@@ -472,6 +472,11 @@ RCT_EXPORT_METHOD(clearLocalNotification){
472
472
  }
473
473
  }
474
474
 
475
+ RCT_EXPORT_METHOD(clearLocalNotification){
476
+ [PushNotificationManager clearNotificationCenter];
477
+ }
478
+
479
+
475
480
  RCT_EXPORT_METHOD(enableHuaweiPushNotifications) {
476
481
  // available in Android only
477
482
  }
Binary file