react-native-insider 4.3.1 → 4.4.0

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/RNInsider.podspec CHANGED
@@ -9,7 +9,7 @@ Pod::Spec.new do |s|
9
9
  s.authors = package_json['author']
10
10
  s.license = 'MIT'
11
11
  s.platform = :ios, '10.0'
12
- s.source = {:http => 'https://mobilesdk.useinsider.com/iOS/11.1.0/InsiderMobileIOSFramework.zip'}
12
+ s.source = {:http => 'https://mobilesdk.useinsider.com/iOS/11.3.2/InsiderMobileIOSFramework.zip'}
13
13
  s.source_files = 'ios/RNInsider/*.{h,m}'
14
14
  s.requires_arc = true
15
15
  s.static_framework = true
@@ -36,7 +36,7 @@ android {
36
36
 
37
37
  dependencies {
38
38
  implementation "com.facebook.react:react-native:${getVersionFromPartner('reactNativeVersion', '+')}"
39
- implementation ('com.useinsider:insider:12.2.2')
39
+ implementation ('com.useinsider:insider:12.3.0')
40
40
  implementation ('com.useinsider:insiderhybrid:1.1.3')
41
41
 
42
42
  implementation 'com.google.android.play:core:1.10.1'
@@ -44,7 +44,7 @@ dependencies {
44
44
  implementation 'com.google.android.gms:play-services-location:17.0.0'
45
45
  implementation 'com.google.firebase:firebase-messaging:20.0.0'
46
46
  implementation 'com.google.android.gms:play-services-ads:16.0.0'
47
- implementation 'androidx.lifecycle:lifecycle-process:2.2.0'
47
+ implementation 'androidx.lifecycle:lifecycle-process:2.3.1'
48
48
 
49
49
  implementation 'com.huawei.hms:push:5.3.0.304'
50
50
  implementation 'com.huawei.hms:ads-identifier:3.4.34.301'
@@ -2,6 +2,8 @@ package com.useinsider.react;
2
2
 
3
3
  import android.app.Application;
4
4
 
5
+ import android.os.Handler;
6
+ import android.os.Looper;
5
7
  import com.facebook.react.bridge.Callback;
6
8
  import com.facebook.react.bridge.ReactApplicationContext;
7
9
  import com.facebook.react.bridge.ReactContextBaseJavaModule;
@@ -32,6 +34,7 @@ import java.util.Map;
32
34
  public class RNInsiderModule extends ReactContextBaseJavaModule {
33
35
 
34
36
  private final ReactApplicationContext reactContext;
37
+ private boolean isCoreInited = false;
35
38
 
36
39
  public RNInsiderModule(ReactApplicationContext reactContext) {
37
40
  super(reactContext);
@@ -53,31 +56,42 @@ public class RNInsiderModule extends ReactContextBaseJavaModule {
53
56
  }
54
57
 
55
58
  @ReactMethod
56
- public void init(String partnerName, String sdkVersion) {
59
+ public void init(final String partnerName, final String sdkVersion) {
57
60
  try {
58
61
  if (Insider.Instance.isSDKInitialized()) {
59
62
  return;
60
63
  }
61
- Insider.Instance.init(((Application) reactContext.getApplicationContext()), partnerName);
62
- Insider.Instance.setSDKType("react-native");
63
- Insider.Instance.setHybridSDKVersion(sdkVersion);
64
- Insider.Instance.resumeSession(reactContext.getCurrentActivity());
65
- Insider.Instance.registerInsiderCallback(new InsiderCallback() {
66
- DeviceEventManagerModule.RCTDeviceEventEmitter emitter = getReactApplicationContext()
67
- .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class);
68
-
64
+ new Handler(Looper.getMainLooper()).post(new Runnable() {
69
65
  @Override
70
- public void doAction(JSONObject jsonObject, InsiderCallbackType insiderCallbackType) {
71
- try {
72
- WritableMap callbackData = RNUtils.convertJSONObjectToMap(jsonObject);
73
- emitter.emit(insiderCallbackType.name(), callbackData);
74
- } catch (Exception e) {
75
- Insider.Instance.putException(e);
66
+ public void run() {
67
+ Insider.Instance.init(((Application) reactContext.getApplicationContext()), partnerName);
68
+ Insider.Instance.setSDKType("react-native");
69
+ Insider.Instance.setHybridSDKVersion(sdkVersion);
70
+
71
+ Insider.Instance.resumeSessionHybridReactConfig(reactContext.getCurrentActivity());
72
+ if (isCoreInited) {
73
+ Insider.Instance.resumeSessionHybridReactRequestConfig();
76
74
  }
75
+ isCoreInited = true;
76
+
77
+ Insider.Instance.registerInsiderCallback(new InsiderCallback() {
78
+ DeviceEventManagerModule.RCTDeviceEventEmitter emitter = getReactApplicationContext()
79
+ .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class);
80
+
81
+ @Override
82
+ public void doAction(JSONObject jsonObject, InsiderCallbackType insiderCallbackType) {
83
+ try {
84
+ WritableMap callbackData = RNUtils.convertJSONObjectToMap(jsonObject);
85
+ emitter.emit(insiderCallbackType.name(), callbackData);
86
+ } catch (Exception e) {
87
+ Insider.Instance.putException(e);
88
+ }
89
+ }
90
+ });
91
+ Insider.Instance.handleHybridIntent();
92
+ Insider.Instance.storePartnerName(partnerName);
77
93
  }
78
94
  });
79
- Insider.Instance.handleHybridIntent();
80
- Insider.Instance.storePartnerName(partnerName);
81
95
  } catch (Exception e) {
82
96
  Insider.Instance.putException(e);
83
97
  }
@@ -0,0 +1,4 @@
1
+ 4.4.0 RELEASE
2
+
3
+ Updated Android to 12.3.0
4
+ SDK inititalization in the main thread
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-insider",
3
- "version": "4.3.1",
3
+ "version": "4.4.0",
4
4
  "description": "React Native Insider SDK",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -1,4 +0,0 @@
1
- 4.3.1 RELEASE
2
-
3
- MOB-10418 | Remove Deprecated DeviceEmitter
4
- set ios version to 11.3.2