@trycourier/courier-react-native 2.0.0-beta7 → 2.0.0-beta9

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.
@@ -101,7 +101,7 @@ dependencies {
101
101
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
102
102
 
103
103
  // Courier Core SDK
104
- api 'com.github.trycourier:courier-android:2.0.32'
104
+ api 'com.github.trycourier:courier-android:2.0.37'
105
105
  api 'androidx.recyclerview:recyclerview:1.3.1'
106
106
 
107
107
  }
@@ -26,9 +26,7 @@ class CourierReactNativeViewManager : SimpleViewManager<CourierInbox>() {
26
26
 
27
27
  override fun getName() = "CourierReactNativeView"
28
28
 
29
- override fun createViewInstance(reactContext: ThemedReactContext): CourierInbox {
30
- return CourierInbox(reactContext)
31
- }
29
+ override fun createViewInstance(reactContext: ThemedReactContext): CourierInbox = CourierInbox(reactContext)
32
30
 
33
31
  private val View.reactContext: ThemedReactContext get() = context as ThemedReactContext
34
32
 
@@ -65,10 +65,14 @@ NSUInteger notificationPresentationOptions = UNNotificationPresentationOptionNon
65
65
  }
66
66
  ];
67
67
 
68
- NSDictionary *pushNotification = [Courier formatPushNotificationWithContent:content];
69
- [[NSNotificationCenter defaultCenter] postNotificationName:@"pushNotificationDelivered" object:nil userInfo:pushNotification];
68
+ dispatch_async(dispatch_get_main_queue(), ^{
70
69
 
71
- completionHandler(notificationPresentationOptions);
70
+ NSDictionary *pushNotification = [Courier formatPushNotificationWithContent:content];
71
+ [[NSNotificationCenter defaultCenter] postNotificationName:@"pushNotificationDelivered" object:nil userInfo:pushNotification];
72
+
73
+ completionHandler(notificationPresentationOptions);
74
+
75
+ });
72
76
 
73
77
  }
74
78
 
@@ -86,11 +90,13 @@ NSUInteger notificationPresentationOptions = UNNotificationPresentationOptionNon
86
90
  }
87
91
  ];
88
92
 
89
- NSDictionary *pushNotification = [Courier formatPushNotificationWithContent:content];
90
- [[NSNotificationCenter defaultCenter] postNotificationName:@"pushNotificationClicked" object:nil userInfo:pushNotification];
91
-
92
93
  dispatch_async(dispatch_get_main_queue(), ^{
94
+
95
+ NSDictionary *pushNotification = [Courier formatPushNotificationWithContent:content];
96
+ [[NSNotificationCenter defaultCenter] postNotificationName:@"pushNotificationClicked" object:nil userInfo:pushNotification];
97
+
93
98
  completionHandler();
99
+
94
100
  });
95
101
 
96
102
  }
@@ -95,8 +95,13 @@ RCT_EXTERN__BLOCKING_SYNCHRONOUS_METHOD(
95
95
  setInboxPaginationLimit: (double)limit
96
96
  )
97
97
 
98
- RCT_EXTERN__BLOCKING_SYNCHRONOUS_METHOD(
98
+ RCT_EXTERN_METHOD(
99
99
  registerPushNotificationClickedOnKilledState
100
100
  )
101
101
 
102
+ + (BOOL)requiresMainQueueSetup
103
+ {
104
+ return YES;
105
+ }
106
+
102
107
  @end
@@ -129,17 +129,13 @@ class CourierReactNativeModule: RCTEventEmitter {
129
129
 
130
130
  }
131
131
 
132
- @objc func registerPushNotificationClickedOnKilledState() -> String {
133
-
134
- let event = CourierReactNativeModule.PushEvents.CLICKED_EVENT
132
+ @objc func registerPushNotificationClickedOnKilledState() {
135
133
 
136
134
  sendMessage(
137
- name: event,
135
+ name: CourierReactNativeModule.PushEvents.CLICKED_EVENT,
138
136
  message: lastClickedMessage
139
137
  )
140
138
 
141
- return event
142
-
143
139
  }
144
140
 
145
141
  @objc(getNotificationPermissionStatus: withRejecter:)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trycourier/courier-react-native",
3
- "version": "2.0.0-beta7",
3
+ "version": "2.0.0-beta9",
4
4
  "description": "Inbox & Push Notifications for React Native",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",