@selligent-marketing-cloud/selligent-react-native 4.3.1 → 4.3.2

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.
@@ -16,11 +16,11 @@ apply plugin: 'com.android.library'
16
16
 
17
17
  android {
18
18
  namespace 'com.selligent'
19
- compileSdk 34
19
+ compileSdk 36
20
20
 
21
21
  defaultConfig {
22
22
  minSdkVersion 23
23
- targetSdkVersion 34
23
+ targetSdkVersion 36
24
24
  }
25
25
 
26
26
  buildFeatures {
@@ -5,6 +5,7 @@ import android.app.Activity;
5
5
  import android.app.Application;
6
6
  import android.content.Context;
7
7
  import android.content.Intent;
8
+ import android.util.Log;
8
9
 
9
10
  import androidx.annotation.NonNull;
10
11
  import androidx.appcompat.app.AppCompatActivity;
@@ -295,6 +296,12 @@ public class RNSelligent extends ReactContextBaseJavaModule implements Lifecycle
295
296
  currentActivity.registerReceiver(this.receiver, this.receiver.getIntentFilter());
296
297
  }
297
298
 
299
+ if (RNSelligent.getManager() == null)
300
+ {
301
+ Log.d(Manager.RN_SELLIGENT_NAME, "onHostResume: RNSelligent.getManager is null.");
302
+ return;
303
+ }
304
+
298
305
  RNSelligent.getManager().checkAndDisplayMessage(currentActivity.getIntent(), currentActivity, this::broadcastEvent);
299
306
  }
300
307
 
@@ -302,7 +309,7 @@ public class RNSelligent extends ReactContextBaseJavaModule implements Lifecycle
302
309
  public void onHostPause() {
303
310
  Activity currentActivity = this.getCurrentActivity();
304
311
 
305
- if (currentActivity == null) { return; }
312
+ if (currentActivity == null || this.receiver == null) { return; }
306
313
 
307
314
  currentActivity.unregisterReceiver(this.receiver);
308
315
  }
@@ -126,11 +126,11 @@ RCT_EXPORT_METHOD(displayNotification:(NSString *)notificationId templateId:(NSS
126
126
  RCT_EXPORT_METHOD(sendEvent:(NSDictionary *)data successCallback:(RCTResponseSenderBlock)successCallback errorCallback:(RCTResponseSenderBlock)errorCallback) {
127
127
  [RNSelligent sendEvent:data completion:^(BOOL status, NSString *message) {
128
128
  if (status) {
129
- successCallback(@[message, [NSNull null]]);
129
+ successCallback(@[message ?: @"", [NSNull null]]);
130
130
  return;
131
131
  }
132
132
 
133
- errorCallback(@[message, [NSNull null]]);
133
+ errorCallback(@[message ?: @"Unknown error", [NSNull null]]);
134
134
  }];
135
135
  }
136
136
 
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  },
5
5
  "name": "@selligent-marketing-cloud/selligent-react-native",
6
6
  "title": "Selligent by Zeta React Native",
7
- "version": "4.3.1",
7
+ "version": "4.3.2",
8
8
  "description": "React Native wrapper for the Selligent by Zeta Android and iOS SDKs",
9
9
  "main": "index.js",
10
10
  "repository": {