pushwoosh-react-native-plugin 6.1.5 → 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.5",
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.5"
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'
@@ -7,7 +7,7 @@ buildscript {
7
7
  }
8
8
 
9
9
  dependencies {
10
- classpath 'com.android.tools.build:gradle:3.6.3'
10
+ classpath 'com.android.tools.build:gradle:3.6.4'
11
11
  classpath 'com.google.gms:google-services:4.3.3'
12
12
  }
13
13
  }
@@ -38,7 +38,7 @@ android {
38
38
  }
39
39
 
40
40
  ext {
41
- pushwoosh = "6.2.7"
41
+ pushwoosh = "6.3.6"
42
42
  }
43
43
 
44
44
  evaluationDependsOn(':app')
@@ -63,6 +63,6 @@ dependencies {
63
63
  implementation "com.pushwoosh:pushwoosh-inbox:${pushwoosh}"
64
64
  implementation "com.pushwoosh:pushwoosh-inbox-ui:${pushwoosh}"
65
65
  implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.71"
66
- implementation "com.google.firebase:firebase-messaging:(+,20.2.2)"
66
+ implementation "com.google.firebase:firebase-messaging:(+,22.0.99]"
67
67
  }
68
68
 
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
3
3
  distributionPath=wrapper/dists
4
4
  zipStoreBase=GRADLE_USER_HOME
5
5
  zipStorePath=wrapper/dists
6
- distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
6
+ distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
@@ -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);
@@ -26,6 +26,9 @@ typedef NSString * (^PWIDateFormatterBlock)(NSDate *date, NSObject *owner);
26
26
  //! The default text color
27
27
  @property (nonatomic, readwrite) UIColor *defaultTextColor;
28
28
 
29
+ //! The text color of a read notification
30
+ @property (nonatomic, readwrite) UIColor *readTextColor;
31
+
29
32
  //! The default background color
30
33
  @property (nonatomic, readwrite) UIColor *backgroundColor;
31
34
 
@@ -53,6 +56,9 @@ typedef NSString * (^PWIDateFormatterBlock)(NSDate *date, NSObject *owner);
53
56
  //! The color of message titles
54
57
  @property (nonatomic, readwrite) UIColor *titleColor;
55
58
 
59
+ //! The title color for read notifications
60
+ @property (nonatomic, readwrite) UIColor *readTitleColor;
61
+
56
62
  //! The color of messages descriptions
57
63
  @property (nonatomic, readwrite) UIColor *descriptionColor;
58
64
 
@@ -31,4 +31,9 @@
31
31
  */
32
32
  + (PWIInboxViewController *)createInboxControllerWithStyle:(PWIInboxStyle *)style;
33
33
 
34
+ /**
35
+ @return PWIInboxViewController with a specified style and height of table view
36
+ */
37
+ + (PWIInboxViewController *)createInboxControllerWithStyle:(PWIInboxStyle *)style andContentHeight:(CGFloat)contentHeight;
38
+
34
39
  @end
@@ -5,7 +5,10 @@
5
5
  //
6
6
 
7
7
  #import <Foundation/Foundation.h>
8
+
9
+ #if TARGET_OS_IOS || TARGET_OS_WATCH
8
10
  #import <UIKit/UIKit.h>
11
+ #endif
9
12
 
10
13
  FOUNDATION_EXPORT NSTimeInterval const PWRichMediaStyleDefaultAnimationDuration;
11
14
 
@@ -17,13 +20,14 @@ FOUNDATION_EXPORT NSTimeInterval const PWRichMediaStyleDefaultAnimationDuration;
17
20
  /**
18
21
  This method can be used to animate Rich Media presenting view.
19
22
  */
23
+ #if TARGET_OS_IOS || TARGET_OS_WATCH
20
24
  - (void)runPresentingAnimationWithContentView:(UIView *)contentView parentView:(UIView *)parentView completion:(dispatch_block_t)completion;
21
25
 
22
26
  /**
23
27
  This method can be used to animate Rich Media dismissing view.
24
28
  */
25
29
  - (void)runDismissingAnimationWithContentView:(UIView *)contentView parentView:(UIView *)parentView completion:(dispatch_block_t)completion;
26
-
30
+ #endif
27
31
  @end
28
32
 
29
33
  /**
@@ -52,6 +56,7 @@ FOUNDATION_EXPORT NSTimeInterval const PWRichMediaStyleDefaultAnimationDuration;
52
56
  /**
53
57
  Custom Rich Media loading view. It is shown while Rich Media is loading.
54
58
  */
59
+ #if TARGET_OS_IOS || TARGET_OS_WATCH
55
60
  @interface PWLoadingView : UIView
56
61
 
57
62
  @property (nonatomic) IBOutlet UIActivityIndicatorView *activityIndicatorView;
@@ -59,10 +64,8 @@ FOUNDATION_EXPORT NSTimeInterval const PWRichMediaStyleDefaultAnimationDuration;
59
64
 
60
65
  @end
61
66
 
62
-
63
67
  typedef PWLoadingView *(^PWRichMediaLoadingViewBlock)(void);
64
-
65
-
68
+ #endif
66
69
  /**
67
70
  'PWRichMediaStyle' class allows customizing the appearance of Rich Media pages.
68
71
  */
@@ -71,7 +74,11 @@ typedef PWLoadingView *(^PWRichMediaLoadingViewBlock)(void);
71
74
  /**
72
75
  Background color of Rich Media pages.
73
76
  */
77
+ #if TARGET_OS_IOS || TARGET_OS_WATCH
74
78
  @property (nonatomic) UIColor *backgroundColor;
79
+ #elif TARGET_OS_OSX
80
+ @property (nonatomic) NSColor *backgroundColor;
81
+ #endif
75
82
 
76
83
  /**
77
84
  Delegate to manage Rich Media presenting animation.
@@ -88,8 +95,9 @@ typedef PWLoadingView *(^PWRichMediaLoadingViewBlock)(void);
88
95
  };
89
96
  @endcode
90
97
  */
98
+ #if TARGET_OS_IOS
91
99
  @property (nonatomic) PWRichMediaLoadingViewBlock loadingViewBlock;
92
-
100
+ #endif
93
101
  /**
94
102
  Delay of the close button presenting in seconds.
95
103
  */
@@ -18,8 +18,7 @@
18
18
 
19
19
  #endif
20
20
 
21
-
22
- #define PUSHWOOSH_VERSION @"6.1.1"
21
+ #define PUSHWOOSH_VERSION @"6.3.1"
23
22
 
24
23
 
25
24
  @class Pushwoosh, PWMessage, PWNotificationCenterDelegateProxy;
@@ -391,15 +390,6 @@ Unregisters from push notifications.
391
390
  */
392
391
  - (void)setUser:(NSString *)userId email:(NSString *)email completion:(void(^)(NSError * error))completion;
393
392
 
394
- /**
395
- Set User indentifier. This could be Facebook ID, username or email, or any other user ID.
396
- This allows data and events to be matched across multiple user devices.
397
-
398
- @param userId user identifier
399
- @param email user's email string
400
- */
401
- - (void)setUser:(NSString *)userId email:(NSString *)email;
402
-
403
393
  /**
404
394
  Register emails list associated to the current user.
405
395
  If setEmails succeeds competion is called with nil argument. If setEmails fails completion is called with error.
@@ -440,20 +430,35 @@ Unregisters from push notifications.
440
430
  */
441
431
  - (void)mergeUserId:(NSString *)oldUserId to:(NSString *)newUserId doMerge:(BOOL)doMerge completion:(void (^)(NSError *error))completion;
442
432
 
433
+ /**
434
+ Starts communication with Pushwoosh server.
435
+ */
436
+ - (void)startServerCommunication;
437
+
438
+ /**
439
+ Stops communication with Pushwoosh server.
440
+ */
441
+ - (void)stopServerCommunication;
442
+
443
443
  /**
444
444
  Process URL of some deep link. Primarly used for register test devices.
445
445
 
446
446
  @param url Deep Link URL
447
447
  */
448
+ #if TARGET_OS_IOS || TARGET_OS_WATCH
448
449
  - (BOOL)handleOpenURL:(NSURL *)url;
450
+ #endif
449
451
 
450
452
  @end
451
453
 
452
454
  /**
453
455
  `PWNotificationCenterDelegateProxy` class handles notifications on iOS 10 and forwards methods of UNUserNotificationCenterDelegate to all added delegates.
454
456
  */
457
+ #if TARGET_OS_IOS || TARGET_OS_WATCH
455
458
  @interface PWNotificationCenterDelegateProxy : NSObject <UNUserNotificationCenterDelegate>
456
-
459
+ #elif TARGET_OS_OSX
460
+ @interface PWNotificationCenterDelegateProxy : NSObject <NSUserNotificationCenterDelegate>
461
+ #endif
457
462
  /**
458
463
  Returns UNUserNotificationCenterDelegate that handles foreground push notifications on iOS10
459
464
  */
@@ -466,8 +471,9 @@ Unregisters from push notifications.
466
471
  /**
467
472
  Adds extra UNUserNotificationCenterDelegate that handles foreground push notifications on iOS10.
468
473
  */
474
+ #if TARGET_OS_IOS || TARGET_OS_WATCH
469
475
  - (void)addNotificationCenterDelegate:(id<UNUserNotificationCenterDelegate>)delegate;
470
-
476
+ #endif
471
477
  @end
472
478
 
473
479
 
@@ -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
Binary file