@imatis/react-native-notifications 4.2.4-imatis.21 → 4.3.1-imatis.24

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.
Files changed (41) hide show
  1. package/CHANGELOG.gren.md +167 -79
  2. package/android/app/src/reactNative59/reactNative59.iml +11 -0
  3. package/android/app/src/reactNative60/reactNative60.iml +11 -0
  4. package/lib/android/.gradle/6.1.1/executionHistory/executionHistory.lock +0 -0
  5. package/lib/android/.gradle/6.1.1/fileHashes/fileHashes.bin +0 -0
  6. package/lib/android/.gradle/6.1.1/fileHashes/fileHashes.lock +0 -0
  7. package/lib/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  8. package/lib/android/.gradle/buildOutputCleanup/cache.properties +1 -1
  9. package/lib/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  10. package/lib/android/.gradle/checksums/checksums.lock +0 -0
  11. package/lib/android/.gradle/checksums/md5-checksums.bin +0 -0
  12. package/lib/android/.gradle/checksums/sha1-checksums.bin +0 -0
  13. package/lib/android/app/src/main/java/com/wix/reactnativenotifications/RNNotificationsModule.java +3 -1
  14. package/lib/android/app/src/main/java/com/wix/reactnativenotifications/core/ReactAppLifecycleFacade.java +5 -1
  15. package/lib/android/local.properties +2 -2
  16. package/lib/dist/adapters/NativeEventsReceiver.d.ts +1 -0
  17. package/lib/dist/adapters/NativeEventsReceiver.js +3 -0
  18. package/lib/dist/events/EventsRegistry.d.ts +1 -0
  19. package/lib/dist/events/EventsRegistry.js +3 -0
  20. package/lib/ios/RNEventEmitter.h +1 -0
  21. package/lib/ios/RNEventEmitter.m +1 -0
  22. package/lib/ios/RNNotificationCenter.m +4 -0
  23. package/lib/ios/RNNotifications.xcodeproj/project.xcworkspace/xcuserdata/troy.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  24. package/lib/src/adapters/NativeEventsReceiver.ts +6 -2
  25. package/lib/src/events/EventsRegistry.ts +4 -0
  26. package/package-lock.json +13507 -0
  27. package/package.json +2 -2
  28. package/react-native.config.js +0 -1
  29. package/lib/android/.gradle/6.1.1/executionHistory/executionHistory.bin +0 -0
  30. package/lib/android/.gradle/6.1.1/fileContent/fileContent.lock +0 -0
  31. package/lib/android/.gradle/6.1.1/fileHashes/resourceHashesCache.bin +0 -0
  32. package/lib/android/.gradle/6.1.1/javaCompile/classAnalysis.bin +0 -0
  33. package/lib/android/.gradle/6.1.1/javaCompile/jarAnalysis.bin +0 -0
  34. package/lib/android/.gradle/6.1.1/javaCompile/javaCompile.lock +0 -0
  35. package/lib/android/.gradle/6.1.1/javaCompile/taskHistory.bin +0 -0
  36. package/lib/android/app/src/test/java/com/wix/reactnativenotifications/core/AppLaunchHelperTest.java +0 -117
  37. package/lib/android/app/src/test/java/com/wix/reactnativenotifications/core/InitialNotificationHolderTest.java +0 -59
  38. package/lib/android/app/src/test/java/com/wix/reactnativenotifications/core/JsIOHelperTest.java +0 -60
  39. package/lib/android/app/src/test/java/com/wix/reactnativenotifications/core/notification/PushNotificationTest.java +0 -381
  40. package/lib/android/app/src/test/java/com/wix/reactnativenotifications/core/notificationdrawer/PushNotificationsDrawerTest.java +0 -96
  41. package/lib/android/app/src/test/resources/robolectric.properties +0 -1
@@ -0,0 +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$/java" isTestSource="false" />
7
+ </content>
8
+ <orderEntry type="inheritedJdk" />
9
+ <orderEntry type="sourceFolder" forTests="false" />
10
+ </component>
11
+ </module>
@@ -0,0 +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$/java" isTestSource="false" />
7
+ </content>
8
+ <orderEntry type="inheritedJdk" />
9
+ <orderEntry type="sourceFolder" forTests="false" />
10
+ </component>
11
+ </module>
@@ -1,2 +1,2 @@
1
- #Tue Mar 22 09:43:34 CET 2022
1
+ #Mon Jul 12 10:27:56 ICT 2021
2
2
  gradle.version=6.1.1
@@ -88,8 +88,10 @@ public class RNNotificationsModule extends ReactContextBaseJavaModule implements
88
88
  return;
89
89
  }
90
90
 
91
- InitialNotificationHolder.getInstance().clear();
92
91
  result = Arguments.fromBundle(notification.asBundle());
92
+ InitialNotificationHolder.getInstance().clear();
93
+ } catch (NullPointerException e) {
94
+ Log.e(LOGTAG, "getInitialNotification: Null pointer exception");
93
95
  } finally {
94
96
  promise.resolve(result);
95
97
  }
@@ -47,7 +47,11 @@ public class ReactAppLifecycleFacade implements AppLifecycleFacade {
47
47
  return false;
48
48
  }
49
49
 
50
- return mReactContext.hasActiveCatalystInstance();
50
+ try {
51
+ return mReactContext.hasActiveCatalystInstance();
52
+ } catch (Exception e) {
53
+ return mReactContext.hasActiveReactInstance();
54
+ }
51
55
  }
52
56
 
53
57
  @Override
@@ -4,5 +4,5 @@
4
4
  # Location of the SDK. This is only used by Gradle.
5
5
  # For customization when using a Version Control System, please read the
6
6
  # header note.
7
- #Tue Mar 22 09:43:01 CET 2022
8
- sdk.dir=/Users/larserlingdahl/Library/Android/sdk
7
+ #Mon Jul 12 10:26:56 ICT 2021
8
+ sdk.dir=/Users/troy/Library/Android/sdk
@@ -15,4 +15,5 @@ export declare class NativeEventsReceiver {
15
15
  registerPushKitNotificationReceived(callback: (event: object) => void): EmitterSubscription;
16
16
  registerNotificationOpened(callback: (notification: Notification, actionResponse?: NotificationActionResponse) => void): EmitterSubscription;
17
17
  registerRemoteNotificationsRegistrationFailed(callback: (event: RegistrationError) => void): EmitterSubscription;
18
+ registerRemoteNotificationsRegistrationDenied(callback: () => void): EmitterSubscription;
18
19
  }
@@ -39,5 +39,8 @@ class NativeEventsReceiver {
39
39
  registerRemoteNotificationsRegistrationFailed(callback) {
40
40
  return this.emitter.addListener('remoteNotificationsRegistrationFailed', callback);
41
41
  }
42
+ registerRemoteNotificationsRegistrationDenied(callback) {
43
+ return this.emitter.addListener('remoteNotificationsRegistrationDenied', callback);
44
+ }
42
45
  }
43
46
  exports.NativeEventsReceiver = NativeEventsReceiver;
@@ -14,4 +14,5 @@ export declare class EventsRegistry {
14
14
  registerNotificationReceivedBackground(callback: (notification: Notification, completion: (response: NotificationBackgroundFetchResult) => void) => void): EmitterSubscription;
15
15
  registerNotificationOpened(callback: (notification: Notification, completion: () => void, actionResponse?: NotificationActionResponse) => void): EmitterSubscription;
16
16
  registerRemoteNotificationsRegistrationFailed(callback: (event: RegistrationError) => void): EmitterSubscription;
17
+ registerRemoteNotificationsRegistrationDenied(callback: () => void): EmitterSubscription;
17
18
  }
@@ -21,5 +21,8 @@ class EventsRegistry {
21
21
  registerRemoteNotificationsRegistrationFailed(callback) {
22
22
  return this.nativeEventsReceiver.registerRemoteNotificationsRegistrationFailed(callback);
23
23
  }
24
+ registerRemoteNotificationsRegistrationDenied(callback) {
25
+ return this.nativeEventsReceiver.registerRemoteNotificationsRegistrationDenied(callback);
26
+ }
24
27
  }
25
28
  exports.EventsRegistry = EventsRegistry;
@@ -1,6 +1,7 @@
1
1
  #import <React/RCTEventEmitter.h>
2
2
 
3
3
  static NSString* const RNRegistered = @"remoteNotificationsRegistered";
4
+ static NSString* const RNRegistrationDenied = @"remoteNotificationsRegistrationDenied";
4
5
  static NSString* const RNRegistrationFailed = @"remoteNotificationsRegistrationFailed";
5
6
  static NSString* const RNPushKitRegistered = @"pushKitRegistered";
6
7
  static NSString* const RNNotificationReceived = @"notificationReceived";
@@ -6,6 +6,7 @@ RCT_EXPORT_MODULE();
6
6
 
7
7
  -(NSArray<NSString *> *)supportedEvents {
8
8
  return @[RNRegistered,
9
+ RNRegistrationDenied,
9
10
  RNRegistrationFailed,
10
11
  RNPushKitRegistered,
11
12
  RNNotificationReceived,
@@ -1,3 +1,4 @@
1
+ #import "RNEventEmitter.h"
1
2
  #import "RNNotificationCenter.h"
2
3
  #import "RCTConvert+RNNotifications.h"
3
4
 
@@ -40,6 +41,9 @@
40
41
  }
41
42
  }];
42
43
  }
44
+ if (!error && !granted) {
45
+ [RNEventEmitter sendEvent:RNRegistrationDenied body:nil];
46
+ }
43
47
  }];
44
48
  }
45
49
 
@@ -25,13 +25,13 @@ export class NativeEventsReceiver {
25
25
  }
26
26
 
27
27
  public registerNotificationReceived(callback: (notification: Notification) => void): EmitterSubscription {
28
- return this.emitter.addListener('notificationReceived', (payload) => {
28
+ return this.emitter.addListener('notificationReceived', (payload: unknown) => {
29
29
  callback(this.notificationFactory.fromPayload(payload));
30
30
  });
31
31
  }
32
32
 
33
33
  public registerNotificationReceivedBackground(callback: (notification: Notification) => void): EmitterSubscription {
34
- return this.emitter.addListener('notificationReceivedBackground', (payload) => {
34
+ return this.emitter.addListener('notificationReceivedBackground', (payload: unknown) => {
35
35
  callback(this.notificationFactory.fromPayload(payload));
36
36
  });
37
37
  }
@@ -50,4 +50,8 @@ export class NativeEventsReceiver {
50
50
  public registerRemoteNotificationsRegistrationFailed(callback: (event: RegistrationError) => void): EmitterSubscription {
51
51
  return this.emitter.addListener('remoteNotificationsRegistrationFailed', callback);
52
52
  }
53
+
54
+ public registerRemoteNotificationsRegistrationDenied(callback: () => void): EmitterSubscription {
55
+ return this.emitter.addListener('remoteNotificationsRegistrationDenied', callback);
56
+ }
53
57
  }
@@ -34,4 +34,8 @@ export class EventsRegistry {
34
34
  public registerRemoteNotificationsRegistrationFailed(callback: (event: RegistrationError) => void): EmitterSubscription {
35
35
  return this.nativeEventsReceiver.registerRemoteNotificationsRegistrationFailed(callback);
36
36
  }
37
+
38
+ public registerRemoteNotificationsRegistrationDenied(callback: () => void): EmitterSubscription {
39
+ return this.nativeEventsReceiver.registerRemoteNotificationsRegistrationDenied(callback);
40
+ }
37
41
  }