react-native-insider 4.4.0-nh → 5.0.0-nh
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/.github/CODEOWNERS +8 -0
- package/.github/dependabot.yml +29 -0
- package/.github/workflows/dependabot_workflow.yml +18 -0
- package/.github/workflows/master_release_with_tag.yml +59 -0
- package/.github/workflows/new_release.yml +58 -0
- package/RNInsider.podspec +2 -2
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/useinsider/react/RNInsiderModule.java +76 -19
- package/changelog/4.4.1.md +4 -0
- package/changelog/5.0.0.md +5 -0
- package/index.js +32 -1
- package/ios/RNInsider/RNInsider.m +24 -0
- package/package.json +2 -2
- package/changelog/4.4.0-nh.md +0 -4
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
* @MahammadMD @tugcearar
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
|
|
4
|
+
- package-ecosystem: "gradle"
|
|
5
|
+
directory: "/android"
|
|
6
|
+
schedule:
|
|
7
|
+
interval: "monthly"
|
|
8
|
+
labels:
|
|
9
|
+
- "dependabot"
|
|
10
|
+
- "dependencies"
|
|
11
|
+
open-pull-requests-limit: 10
|
|
12
|
+
|
|
13
|
+
- package-ecosystem: "npm"
|
|
14
|
+
directory: "/"
|
|
15
|
+
schedule:
|
|
16
|
+
interval: "monthly"
|
|
17
|
+
labels:
|
|
18
|
+
- "dependabot"
|
|
19
|
+
- "dependencies"
|
|
20
|
+
open-pull-requests-limit: 10
|
|
21
|
+
|
|
22
|
+
- package-ecosystem: "github-actions"
|
|
23
|
+
directory: "/"
|
|
24
|
+
schedule:
|
|
25
|
+
interval: "monthly"
|
|
26
|
+
labels:
|
|
27
|
+
- "dependabot"
|
|
28
|
+
- "dependencies"
|
|
29
|
+
open-pull-requests-limit: 10
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
name: Dependabot workflow
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
schedule:
|
|
6
|
+
- cron: "0 13 1 * *"
|
|
7
|
+
jobs:
|
|
8
|
+
dependabot_monthly:
|
|
9
|
+
name: Trigger mobile-devops workflow
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- name: Repository Dispatch
|
|
13
|
+
uses: peter-evans/repository-dispatch@v1
|
|
14
|
+
with:
|
|
15
|
+
token: ${{ secrets.GIT_TOKEN }}
|
|
16
|
+
repository: useinsider/mobile-devops
|
|
17
|
+
event-type: repo-name
|
|
18
|
+
client-payload: '{"repo-name": "react-native-insider"}'
|
|
@@ -0,0 +1,59 @@
|
|
|
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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
|
|
@@ -0,0 +1,58 @@
|
|
|
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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
|
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
|
+
s.source = {:http => 'https://mobilesdk.useinsider.com/iOS/12.0.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', '
|
|
17
|
+
s.dependency 'InsiderMobile', '12.0.0'
|
|
18
18
|
s.dependency 'InsiderHybrid', '1.1.2'
|
|
19
19
|
end
|
package/android/build.gradle
CHANGED
|
@@ -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:
|
|
39
|
+
implementation ('com.useinsider:insider:13.0.1-nh')
|
|
40
40
|
implementation ('com.useinsider:insiderhybrid:1.1.3')
|
|
41
41
|
|
|
42
42
|
implementation 'com.google.android.play:core:1.10.1'
|
|
@@ -68,9 +68,9 @@ public class RNInsiderModule extends ReactContextBaseJavaModule {
|
|
|
68
68
|
Insider.Instance.setSDKType("react-native");
|
|
69
69
|
Insider.Instance.setHybridSDKVersion(sdkVersion);
|
|
70
70
|
|
|
71
|
-
Insider.Instance.
|
|
71
|
+
Insider.Instance.resumeSessionHybridConfig(reactContext.getCurrentActivity());
|
|
72
72
|
if (isCoreInited) {
|
|
73
|
-
Insider.Instance.
|
|
73
|
+
Insider.Instance.resumeSessionHybridRequestConfig();
|
|
74
74
|
}
|
|
75
75
|
isCoreInited = true;
|
|
76
76
|
|
|
@@ -355,12 +355,17 @@ public class RNInsiderModule extends ReactContextBaseJavaModule {
|
|
|
355
355
|
}
|
|
356
356
|
|
|
357
357
|
@ReactMethod
|
|
358
|
-
public void setGDPRConsent(boolean gdprConsent) {
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
358
|
+
public void setGDPRConsent(final boolean gdprConsent) {
|
|
359
|
+
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
|
360
|
+
@Override
|
|
361
|
+
public void run() {
|
|
362
|
+
try {
|
|
363
|
+
Insider.Instance.setGDPRConsent(gdprConsent);
|
|
364
|
+
} catch (Exception e) {
|
|
365
|
+
Insider.Instance.putException(e);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
});
|
|
364
369
|
}
|
|
365
370
|
|
|
366
371
|
@ReactMethod
|
|
@@ -555,11 +560,16 @@ public class RNInsiderModule extends ReactContextBaseJavaModule {
|
|
|
555
560
|
|
|
556
561
|
@ReactMethod
|
|
557
562
|
public void startTrackingGeofence() {
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
+
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
|
564
|
+
@Override
|
|
565
|
+
public void run() {
|
|
566
|
+
try {
|
|
567
|
+
Insider.Instance.startTrackingGeofence();
|
|
568
|
+
} catch (Exception e) {
|
|
569
|
+
Insider.Instance.putException(e);
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
});
|
|
563
573
|
}
|
|
564
574
|
|
|
565
575
|
@ReactMethod
|
|
@@ -597,12 +607,17 @@ public class RNInsiderModule extends ReactContextBaseJavaModule {
|
|
|
597
607
|
}
|
|
598
608
|
|
|
599
609
|
@ReactMethod
|
|
600
|
-
public void enableIDFACollection(boolean enableIDFACollection) {
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
610
|
+
public void enableIDFACollection(final boolean enableIDFACollection) {
|
|
611
|
+
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
|
612
|
+
@Override
|
|
613
|
+
public void run() {
|
|
614
|
+
try {
|
|
615
|
+
Insider.Instance.enableIDFACollection(enableIDFACollection);
|
|
616
|
+
} catch (Exception e) {
|
|
617
|
+
Insider.Instance.putException(e);
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
});
|
|
606
621
|
}
|
|
607
622
|
|
|
608
623
|
@ReactMethod
|
|
@@ -632,4 +647,46 @@ public class RNInsiderModule extends ReactContextBaseJavaModule {
|
|
|
632
647
|
Insider.Instance.putException(e);
|
|
633
648
|
}
|
|
634
649
|
}
|
|
650
|
+
|
|
651
|
+
@ReactMethod
|
|
652
|
+
public void enableLocationCollection(final boolean consentStatus) {
|
|
653
|
+
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
|
654
|
+
@Override
|
|
655
|
+
public void run() {
|
|
656
|
+
try {
|
|
657
|
+
Insider.Instance.enableLocationCollection(consentStatus);
|
|
658
|
+
} catch (Exception e) {
|
|
659
|
+
Insider.Instance.putException(e);
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
});
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
@ReactMethod
|
|
666
|
+
public void enableIpCollection(final boolean consentStatus) {
|
|
667
|
+
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
|
668
|
+
@Override
|
|
669
|
+
public void run() {
|
|
670
|
+
try {
|
|
671
|
+
Insider.Instance.enableIpCollection(consentStatus);
|
|
672
|
+
} catch (Exception e) {
|
|
673
|
+
Insider.Instance.putException(e);
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
});
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
@ReactMethod
|
|
680
|
+
public void enableCarrierCollection(final boolean consentStatus) {
|
|
681
|
+
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
|
682
|
+
@Override
|
|
683
|
+
public void run() {
|
|
684
|
+
try {
|
|
685
|
+
Insider.Instance.enableCarrierCollection(consentStatus);
|
|
686
|
+
} catch (Exception e) {
|
|
687
|
+
Insider.Instance.putException(e);
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
});
|
|
691
|
+
}
|
|
635
692
|
}
|
package/index.js
CHANGED
|
@@ -141,7 +141,8 @@ export default class RNInsider {
|
|
|
141
141
|
|
|
142
142
|
// Message Center & Smart Recommendation
|
|
143
143
|
static getMessageCenterData(limit: number, startDate: Date, endDate: Date, callback: Function) {
|
|
144
|
-
if (shouldNotProceed() || limit == null || startDate == null || endDate == null || callback == null)
|
|
144
|
+
if (shouldNotProceed() || limit == null || startDate == null || endDate == null || callback == null || startDate.getTime() === endDate.getTime() ||
|
|
145
|
+
startDate.getTime() > endDate.getTime()) return;
|
|
145
146
|
try {
|
|
146
147
|
Insider.getMessageCenterData(limit, startDate.toISOString(), endDate.toISOString(), (messageCenterData) => {
|
|
147
148
|
if (Platform.OS !== 'ios') {
|
|
@@ -322,4 +323,34 @@ export default class RNInsider {
|
|
|
322
323
|
Insider.putErrorLog(generateJSONErrorString(error));
|
|
323
324
|
}
|
|
324
325
|
}
|
|
326
|
+
|
|
327
|
+
static enableLocationCollection (consentStatus) {
|
|
328
|
+
if (shouldNotProceed()) return;
|
|
329
|
+
|
|
330
|
+
try {
|
|
331
|
+
Insider.enableLocationCollection(consentStatus);
|
|
332
|
+
} catch (error) {
|
|
333
|
+
Insider.putErrorLog(generateJSONErrorString(error));
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
static enableIpCollection (consentStatus) {
|
|
338
|
+
if (shouldNotProceed()) return;
|
|
339
|
+
|
|
340
|
+
try {
|
|
341
|
+
Insider.enableIpCollection(consentStatus);
|
|
342
|
+
} catch (error) {
|
|
343
|
+
Insider.putErrorLog(generateJSONErrorString(error));
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
static enableCarrierCollection (consentStatus) {
|
|
348
|
+
if (shouldNotProceed()) return;
|
|
349
|
+
|
|
350
|
+
try {
|
|
351
|
+
Insider.enableCarrierCollection(consentStatus);
|
|
352
|
+
} catch (error) {
|
|
353
|
+
Insider.putErrorLog(generateJSONErrorString(error));
|
|
354
|
+
}
|
|
355
|
+
}
|
|
325
356
|
}
|
|
@@ -460,6 +460,30 @@ RCT_EXPORT_METHOD(showNativeAppReview) {
|
|
|
460
460
|
}
|
|
461
461
|
}
|
|
462
462
|
|
|
463
|
+
RCT_EXPORT_METHOD(enableLocationCollection:(BOOL)enabled) {
|
|
464
|
+
@try {
|
|
465
|
+
[Insider enableLocationCollection:enabled];
|
|
466
|
+
} @catch (NSException *e){
|
|
467
|
+
[Insider sendError:e desc:[NSString stringWithFormat:@"%s:%d", __func__, __LINE__]];
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
RCT_EXPORT_METHOD(enableIpCollection:(BOOL)enabled) {
|
|
472
|
+
@try {
|
|
473
|
+
[Insider enableIpCollection:enabled];
|
|
474
|
+
} @catch (NSException *e){
|
|
475
|
+
[Insider sendError:e desc:[NSString stringWithFormat:@"%s:%d", __func__, __LINE__]];
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
RCT_EXPORT_METHOD(enableCarrierCollection:(BOOL)enabled) {
|
|
480
|
+
@try {
|
|
481
|
+
[Insider enableCarrierCollection:enabled];
|
|
482
|
+
} @catch (NSException *e){
|
|
483
|
+
[Insider sendError:e desc:[NSString stringWithFormat:@"%s:%d", __func__, __LINE__]];
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
|
|
463
487
|
-(void)emitEvent:(NSDictionary *)evetData {
|
|
464
488
|
@try {
|
|
465
489
|
RNNotificationHandler *handler = [[RNNotificationHandler alloc] init];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-insider",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0-nh",
|
|
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
|
+
}
|
package/changelog/4.4.0-nh.md
DELETED