react-native-insider 5.1.0-nh → 5.2.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.
@@ -1,12 +1,25 @@
1
1
  name: gitleaks
2
2
  on: [push]
3
+ env:
4
+ GIT_DISCOVERY_ACROSS_FILESYSTEM: 1
3
5
 
4
6
  jobs:
5
7
  gitleaks:
6
- runs-on: self-hosted
8
+ runs-on: self-runner-node
7
9
  steps:
8
- - uses: actions/checkout@v3
10
+ - name: Checkout Repository
11
+ uses: actions/checkout@v3
9
12
  with:
10
13
  fetch-depth: '2'
14
+ - name: Clone GitLeak Action
15
+ uses: actions/checkout@v3
16
+ with:
17
+ repository: useinsider/gitleaks-action
18
+ ref: master
19
+ token: ${{ secrets.PAT }}
20
+ path: .github/actions/gitleaks-action
21
+ - name: Install Dependencies
22
+ run: npm install
23
+ working-directory: .github/actions/gitleaks-action
11
24
  - name: gitleaks-action
12
- uses: zricethezav/gitleaks-action@master
25
+ uses: ./.github/actions/gitleaks-action
@@ -20,7 +20,7 @@ jobs:
20
20
  ref: develop
21
21
 
22
22
  - name: Setup node
23
- uses: actions/setup-node@v3.2.0
23
+ uses: actions/setup-node@v3.3.0
24
24
  with:
25
25
  node-version: 12
26
26
  registry-url: https://registry.npmjs.org/
@@ -34,6 +34,7 @@ jobs:
34
34
  ./slack_notifier.sh mob-deployment mob-sdk-releaser "$text"
35
35
  env:
36
36
  NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
37
+ SLACK_NOTIFIER_AUTH_KEY: ${{ secrets.SLACK_NOTIFIER_AUTH_KEY }}
37
38
 
38
39
  release-nh:
39
40
  needs: release
@@ -47,7 +48,7 @@ jobs:
47
48
  ref: develop-nh
48
49
 
49
50
  - name: Setup node
50
- uses: actions/setup-node@v3.2.0
51
+ uses: actions/setup-node@v3.3.0
51
52
  with:
52
53
  node-version: 12
53
54
  registry-url: https://registry.npmjs.org/
@@ -60,4 +61,5 @@ jobs:
60
61
  text=":atom_symbol: React Native NH SDK is published with version: ${{ github.event.inputs.version_name }}-nh"
61
62
  ./slack_notifier.sh mob-deployment mob-sdk-releaser "$text"
62
63
  env:
63
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
64
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
65
+ SLACK_NOTIFIER_AUTH_KEY: ${{ secrets.SLACK_NOTIFIER_AUTH_KEY }}
@@ -39,3 +39,5 @@ jobs:
39
39
  run: |
40
40
  text=":tatakae: React Native SDK is ready to test with version: ${{ github.event.client_payload.sdk_version_name }} <!subteam^SUUGFQNVA|mobileqa>"
41
41
  ./slack_notifier.sh mob-deployment mob-sdk-releaser "$text"
42
+ env:
43
+ SLACK_NOTIFIER_AUTH_KEY: ${{ secrets.SLACK_NOTIFIER_AUTH_KEY }}
package/RNInsider.podspec CHANGED
@@ -9,11 +9,11 @@ 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/12.4.0/InsiderMobileIOSFramework.zip'}
12
+ s.source = {:http => 'https://mobilesdk.useinsider.com/iOS/12.5.0/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', '12.4.0'
17
+ s.dependency 'InsiderMobile', '12.5.0'
18
18
  s.dependency 'InsiderHybrid', '1.1.2'
19
19
  end
@@ -27,22 +27,24 @@ android {
27
27
  }
28
28
  }
29
29
 
30
- repositories {
31
- mavenCentral()
32
- maven { url "https://maven.google.com" }
33
- }
30
+ repositories {
31
+ mavenCentral()
32
+ maven { url "https://maven.google.com" }
33
+ }
34
34
 
35
35
 
36
36
  dependencies {
37
37
  implementation "com.facebook.react:react-native:${getVersionFromPartner('reactNativeVersion', '+')}"
38
-
39
- implementation ('com.useinsider:insider:13.3.1-nh')
40
- implementation ('com.useinsider:insiderhybrid:1.1.3')
38
+ implementation ('com.useinsider:insider:13.4.0')
39
+ implementation ('com.useinsider:insiderhybrid:1.1.4')
41
40
 
42
41
  implementation 'androidx.legacy:legacy-support-v4:1.0.0'
43
42
  implementation 'com.google.android.gms:play-services-location:20.0.0'
44
43
  implementation 'com.google.android.gms:play-services-ads:21.0.0'
45
44
  implementation 'com.google.firebase:firebase-messaging:23.0.5'
46
45
  implementation 'androidx.lifecycle:lifecycle-process:2.4.1'
47
-
48
- }
46
+
47
+ implementation 'com.huawei.hms:push:6.5.0.300'
48
+ implementation 'com.huawei.hms:ads-identifier:3.4.39.302'
49
+ implementation 'com.huawei.hms:location:6.3.0.300'
50
+ }
@@ -601,6 +601,10 @@ public class RNInsiderModule extends ReactContextBaseJavaModule {
601
601
  }
602
602
  String provider = Insider.Instance.getCurrentProvider(reactContext);
603
603
  switch (provider) {
604
+ case "huawei":
605
+ com.huawei.hms.push.RemoteMessage hmsRemoteMessage = new com.huawei.hms.push.RemoteMessage.Builder("insider").setData(remoteMessageStringMap).build();
606
+ Insider.Instance.handleHMSNotification(reactContext, hmsRemoteMessage);
607
+ break;
604
608
  case "other":
605
609
  case "google":
606
610
  RemoteMessage fcmRemoteMessage = new RemoteMessage.Builder("insider").setData(remoteMessageStringMap).build();
@@ -698,4 +702,19 @@ public class RNInsiderModule extends ReactContextBaseJavaModule {
698
702
  }
699
703
  });
700
704
  }
705
+
706
+ @ReactMethod
707
+ public void signUpConfirmation() {
708
+ try {
709
+ Insider.Instance.signUpConfirmation();
710
+ } catch (Exception e) {
711
+ Insider.Instance.putException(e);
712
+ }
713
+ }
714
+
715
+ @ReactMethod
716
+ public void setActiveForegroundPushView() {}
717
+
718
+ @ReactMethod
719
+ public void setForegroundPushCallback() {}
701
720
  }
package/index.js CHANGED
@@ -16,6 +16,7 @@ const INAPP_BUTTON_CLICK = 'INAPP_BUTTON_CLICK';
16
16
  const TEMP_STORE_PURCHASE = 'TEMP_STORE_PURCHASE';
17
17
  const TEMP_STORE_ADDED_TO_CART = 'TEMP_STORE_ADDED_TO_CART';
18
18
  const TEMP_STORE_CUSTOM_ACTION = 'TEMP_STORE_CUSTOM_ACTION';
19
+ const FOREGROUND_PUSH = 'FOREGROUND_PUSH';
19
20
 
20
21
  function shouldNotProceed() {
21
22
  return Insider == null;
@@ -369,4 +370,38 @@ export default class RNInsider {
369
370
  Insider.putErrorLog(generateJSONErrorString(error));
370
371
  }
371
372
  }
373
+
374
+ static signUpConfirmation() {
375
+ if (shouldNotProceed()) return;
376
+
377
+ try {
378
+ Insider.signUpConfirmation();
379
+ } catch (error) {
380
+ Insider.putErrorLog(generateJSONErrorString(error));
381
+ }
382
+ }
383
+
384
+ static setForegroundPushCallback (callback) {
385
+ if (shouldNotProceed()) return;
386
+
387
+ try {
388
+ Insider.setForegroundPushCallback();
389
+
390
+ eventHandler.addListener(FOREGROUND_PUSH, notification => {
391
+ callback(notification);
392
+ });
393
+ } catch (error) {
394
+ Insider.putErrorLog(generateJSONErrorString(error));
395
+ }
396
+ }
397
+
398
+ static setActiveForegroundPushView() {
399
+ if (shouldNotProceed()) return;
400
+
401
+ try {
402
+ Insider.setActiveForegroundPushView();
403
+ } catch (error) {
404
+ Insider.putErrorLog(generateJSONErrorString(error));
405
+ }
406
+ }
372
407
  }
@@ -4,6 +4,8 @@
4
4
  #import "RCTBridgeModule.h"
5
5
  #endif
6
6
 
7
+ #import <UserNotifications/UserNotifications.h>
8
+
7
9
  @interface RNInsider : NSObject <RCTBridgeModule>
8
10
 
9
11
  @end
@@ -276,6 +276,14 @@ RCT_EXPORT_METHOD(setGDPRConsent:(BOOL)gdprConsent) {
276
276
  }
277
277
  }
278
278
 
279
+ RCT_EXPORT_METHOD(signUpConfirmation) {
280
+ @try {
281
+ [Insider signUpConfirmation];
282
+ } @catch (NSException *e){
283
+ [Insider sendError:e desc:[NSString stringWithFormat:@"%s:%d", __func__, __LINE__]];
284
+ }
285
+ }
286
+
279
287
  // Insider Product
280
288
  RCT_EXPORT_METHOD(itemPurchased:(NSString *)saleID productMustMap:(NSDictionary *)productMustMap productOptMap:(NSDictionary *)productOptMap) {
281
289
  @try {
@@ -492,6 +500,34 @@ RCT_EXPORT_METHOD(enableCarrierCollection:(BOOL)enabled) {
492
500
  }
493
501
  }
494
502
 
503
+ RCT_EXPORT_METHOD(setForegroundPushCallback) {
504
+ @try {
505
+ [Insider setForegroundPushCallback:@selector(foregroundPushCallback:) sender:self];
506
+ } @catch (NSException *e){
507
+ [Insider sendError:e desc:[NSString stringWithFormat:@"%s:%d", __func__, __LINE__]];
508
+ }
509
+ }
510
+
511
+ RCT_EXPORT_METHOD(setActiveForegroundPushView) {
512
+ @try {
513
+ [Insider setActiveForegroundPushView];
514
+ } @catch (NSException *e){
515
+ [Insider sendError:e desc:[NSString stringWithFormat:@"%s:%d", __func__, __LINE__]];
516
+ }
517
+ }
518
+
519
+ -(void)foregroundPushCallback:(UNNotification *) notification {
520
+ @try {
521
+ if (notification == nil) return;
522
+
523
+ RNNotificationHandler *handler = [[RNNotificationHandler alloc] init];
524
+
525
+ [handler sendDataToJS:@"FOREGROUND_PUSH" data:notification.request.content.userInfo];
526
+ } @catch (NSException *e){
527
+ [Insider sendError:e desc:[NSString stringWithFormat:@"%s:%d", __func__, __LINE__]];
528
+ }
529
+ }
530
+
495
531
  -(void)emitEvent:(NSDictionary *)evetData {
496
532
  @try {
497
533
  RNNotificationHandler *handler = [[RNNotificationHandler alloc] init];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-insider",
3
- "version": "5.1.0-nh",
3
+ "version": "5.2.0",
4
4
  "description": "React Native Insider SDK",
5
5
  "main": "index.js",
6
6
  "keywords": [
package/slack_notifier.sh CHANGED
@@ -9,6 +9,7 @@ generate_post_data()
9
9
  {
10
10
  cat <<EOF
11
11
  {
12
+ "auth_key": "$SLACK_NOTIFIER_AUTH_KEY",
12
13
  "channel": "$CHANNEL",
13
14
  "message": "$TEXT",
14
15
  "username": "$USERNAME"