react-native-insider 4.2.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
@@ -8,12 +8,12 @@ Pod::Spec.new do |s|
8
8
  s.homepage = package_json['homepage']
9
9
  s.authors = package_json['author']
10
10
  s.license = 'MIT'
11
- s.platform = :ios, '9.0'
12
- s.source = {:http => 'https://mobilesdk.useinsider.com/iOS/11.0.0/InsiderMobileIOSFramework.zip'}
11
+ s.platform = :ios, '10.0'
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
16
16
  s.dependency 'React'
17
- s.dependency 'InsiderMobile', '11.0.0'
17
+ s.dependency 'InsiderMobile', '11.3.2'
18
18
  s.dependency 'InsiderHybrid', '1.1.2'
19
19
  end
@@ -24,6 +24,7 @@ android {
24
24
 
25
25
  defaultConfig {
26
26
  minSdkVersion getVersionFromPartner('minSdkVersion', 17)
27
+ multiDexEnabled true
27
28
  }
28
29
  }
29
30
 
@@ -35,16 +36,17 @@ android {
35
36
 
36
37
  dependencies {
37
38
  implementation "com.facebook.react:react-native:${getVersionFromPartner('reactNativeVersion', '+')}"
38
- implementation ('com.useinsider:insider:12.1.0')
39
+ implementation ('com.useinsider:insider:12.3.0')
39
40
  implementation ('com.useinsider:insiderhybrid:1.1.3')
40
41
 
42
+ implementation 'com.google.android.play:core:1.10.1'
41
43
  implementation 'androidx.legacy:legacy-support-v4:1.0.0'
42
44
  implementation 'com.google.android.gms:play-services-location:17.0.0'
43
45
  implementation 'com.google.firebase:firebase-messaging:20.0.0'
44
46
  implementation 'com.google.android.gms:play-services-ads:16.0.0'
45
- implementation 'androidx.lifecycle:lifecycle-process:2.2.0'
47
+ implementation 'androidx.lifecycle:lifecycle-process:2.3.1'
46
48
 
47
- implementation 'com.huawei.hms:push:5.0.4.302'
49
+ implementation 'com.huawei.hms:push:5.3.0.304'
48
50
  implementation 'com.huawei.hms:ads-identifier:3.4.34.301'
49
51
  implementation 'com.huawei.hms:location:4.0.4.300'
50
52
 
@@ -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
  }
@@ -613,4 +627,13 @@ public class RNInsiderModule extends ReactContextBaseJavaModule {
613
627
 
614
628
  }
615
629
  }
630
+
631
+ @ReactMethod
632
+ public void showNativeAppReview() {
633
+ try {
634
+ Insider.Instance.showNativeRating();
635
+ } catch (Exception e) {
636
+ Insider.Instance.putException(e);
637
+ }
638
+ }
616
639
  }
@@ -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/index.js CHANGED
@@ -1,9 +1,8 @@
1
- import { Platform, NativeModules, DeviceEventEmitter, NativeEventEmitter } from 'react-native';
1
+ import { Platform, NativeModules, NativeEventEmitter } from 'react-native';
2
2
 
3
3
  import RNInsiderEvent from './src/InsiderEvent';
4
4
  import RNInsiderUser from './src/InsiderUser';
5
5
  import RNInsiderProduct from './src/InsiderProduct';
6
- import InsiderCallbackType from './src/InsiderCallbackType';
7
6
 
8
7
  var packageJSON = require('./package.json');
9
8
 
@@ -30,11 +29,9 @@ function registerInsiderCallback(insiderCallback) {
30
29
  try {
31
30
  const callbackActions = [NOTIFICATION_OPEN, INAPP_BUTTON_CLICK, TEMP_STORE_PURCHASE, TEMP_STORE_ADDED_TO_CART, TEMP_STORE_CUSTOM_ACTION];
32
31
  callbackActions.forEach((callbackAction, index) => {
33
- if (DeviceEventEmitter.listeners(callbackAction).length === 0) {
34
- eventHandler.addListener(callbackAction, notification => {
35
- insiderCallback(index, notification);
36
- });
37
- }
32
+ eventHandler.addListener(callbackAction, notification => {
33
+ insiderCallback(index, notification);
34
+ });
38
35
  });
39
36
  } catch (error) {
40
37
  Insider.putErrorLog(generateJSONErrorString(error));
@@ -316,4 +313,13 @@ export default class RNInsider {
316
313
  Insider.putErrorLog(generateJSONErrorString(error));
317
314
  }
318
315
  }
316
+
317
+ static showNativeAppReview() {
318
+ if (shouldNotProceed()) return;
319
+ try {
320
+ Insider.showNativeAppReview();
321
+ } catch (error) {
322
+ Insider.putErrorLog(generateJSONErrorString(error));
323
+ }
324
+ }
319
325
  }
@@ -452,6 +452,14 @@ RCT_EXPORT_METHOD(putErrorLog:(NSString *)errorString) {
452
452
  }
453
453
  }
454
454
 
455
+ RCT_EXPORT_METHOD(showNativeAppReview) {
456
+ @try {
457
+ [Insider showNativeAppReview];
458
+ } @catch (NSException *e) {
459
+ [Insider sendError:e desc:[NSString stringWithFormat:@"%s:%d", __func__, __LINE__]];
460
+ }
461
+ }
462
+
455
463
  -(void)emitEvent:(NSDictionary *)evetData {
456
464
  @try {
457
465
  RNNotificationHandler *handler = [[RNNotificationHandler alloc] init];
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Workspace
3
+ version = "1.0">
4
+ <FileRef
5
+ location = "self:">
6
+ </FileRef>
7
+ </Workspace>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>IDEDidComputeMac32BitWarning</key>
6
+ <true/>
7
+ </dict>
8
+ </plist>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-insider",
3
- "version": "4.2.1",
3
+ "version": "4.4.0",
4
4
  "description": "React Native Insider SDK",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -15,4 +15,4 @@
15
15
  ],
16
16
  "author": "insidermobile",
17
17
  "homepage": "https://github.com/useinsider/react-native-insider"
18
- }
18
+ }
@@ -1,8 +0,0 @@
1
- # This is a comment.
2
- # Each line is a file pattern followed by one or more owners.
3
-
4
- # These owners will be the default owners for everything in
5
- # the repo. Unless a later match takes precedence,
6
- # @global-owner1 and @global-owner2 will be requested for
7
- # review when someone opens a pull request.
8
- * @canberksinangil @orkunsoylu
@@ -1,59 +0,0 @@
1
- name: NPM Publish
2
-
3
- on:
4
- push:
5
- tags:
6
- - "*"
7
-
8
- jobs:
9
- release:
10
- name: Create Release
11
- runs-on: ubuntu-latest
12
-
13
- steps:
14
- - name: Checkout code
15
- uses: actions/checkout@v2
16
- with:
17
- ref: develop
18
-
19
- - name: Set release name
20
- run: echo "RELEASE_NAME=$(echo ${GITHUB_REF:10})" >> $GITHUB_ENV
21
-
22
- - name: Create release
23
- id: create_release
24
- uses: actions/create-release@v1
25
- env:
26
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27
- with:
28
- tag_name: ${{ github.ref }}
29
- release_name: ${{ env.RELEASE_NAME }}
30
- body_path: changelog/${{ env.RELEASE_NAME }}.md
31
- draft: false
32
- prerelease: false
33
- build:
34
- runs-on: ubuntu-latest
35
- steps:
36
- - uses: actions/checkout@v2
37
- - uses: actions/setup-node@v1
38
- with:
39
- node-version: 12
40
- - run: npm ci
41
- - run: npm test
42
-
43
- publish-npm:
44
- needs: build
45
- runs-on: ubuntu-latest
46
- steps:
47
- - uses: actions/checkout@v2
48
- - uses: actions/setup-node@v1
49
- with:
50
- node-version: 12
51
- registry-url: https://registry.npmjs.org/
52
- - run: npm ci
53
- - run: npm publish
54
- env:
55
- NODE_AUTH_TOKEN: ${{secrets.npm_token}}
56
- - run: |
57
- text=":atom_symbol: A new version of React Native SDK is published."
58
- object='{"text": "'"$text"'"}'
59
- curl -X POST -H 'Content-type: application/json' --data "$object" https://hooks.slack.com/services/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
@@ -1,58 +0,0 @@
1
- name: NPM Publish
2
-
3
- on:
4
- repository_dispatch:
5
- types: sdk-deploy
6
-
7
- jobs:
8
- release:
9
- name: Create Release
10
- runs-on: ubuntu-latest
11
-
12
- steps:
13
- - name: Checkout code
14
- uses: actions/checkout@v2
15
- with:
16
- ref: develop
17
-
18
- - name: Set release name
19
- run: echo "RELEASE_NAME=${{ github.event.client_payload.sdk_version }}" >> $GITHUB_ENV
20
-
21
- - name: Create release
22
- id: create_release
23
- uses: actions/create-release@v1
24
- env:
25
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26
- with:
27
- tag_name: ${{ github.event.client_payload.sdk_version }}
28
- release_name: ${{ env.RELEASE_NAME }}
29
- body: ${{ github.event.client_payload.description }}
30
- draft: false
31
- prerelease: false
32
- build:
33
- runs-on: ubuntu-latest
34
- steps:
35
- - uses: actions/checkout@v2
36
- - uses: actions/setup-node@v1
37
- with:
38
- node-version: 12
39
- - run: npm ci
40
- - run: npm test
41
-
42
- publish-npm:
43
- needs: build
44
- runs-on: ubuntu-latest
45
- steps:
46
- - uses: actions/checkout@v2
47
- - uses: actions/setup-node@v1
48
- with:
49
- node-version: 12
50
- registry-url: https://registry.npmjs.org/
51
- - run: npm ci
52
- - run: npm publish
53
- env:
54
- NODE_AUTH_TOKEN: ${{secrets.npm_token}}
55
- - run: |
56
- text=":atom_symbol: A new version of React Native SDK is published."
57
- object='{"text": "'"$text"'"}'
58
- curl -X POST -H 'Content-type: application/json' --data "$object" https://hooks.slack.com/services/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
@@ -1,4 +0,0 @@
1
- 4.2.0 RELEASE
2
-
3
- set android version to 11.8.0
4
- set ios version to 11.0.0
@@ -1,3 +0,0 @@
1
- 4.2.1 RELEASE
2
-
3
- Huawei Push Package Version Update