react-native-insider 5.0.0 → 5.0.2-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/workflows/git-leak.yml +12 -0
- package/.github/workflows/master_release_with_tag.yml +5 -5
- package/.github/workflows/new_release.yml +5 -5
- package/RNInsider.podspec +2 -2
- package/android/build.gradle +7 -12
- package/android/src/main/java/com/useinsider/react/RNInsiderModule.java +9 -4
- package/changelog/5.0.2.md +7 -0
- package/index.js +22 -6
- package/ios/RNInsider/RNInsider.m +8 -0
- package/package.json +16 -16
- package/src/InsiderUser.js +211 -201
- package/changelog/5.0.0.md +0 -5
|
@@ -12,7 +12,7 @@ jobs:
|
|
|
12
12
|
|
|
13
13
|
steps:
|
|
14
14
|
- name: Checkout code
|
|
15
|
-
uses: actions/checkout@
|
|
15
|
+
uses: actions/checkout@v3
|
|
16
16
|
with:
|
|
17
17
|
ref: develop
|
|
18
18
|
|
|
@@ -33,8 +33,8 @@ jobs:
|
|
|
33
33
|
build:
|
|
34
34
|
runs-on: ubuntu-latest
|
|
35
35
|
steps:
|
|
36
|
-
- uses: actions/checkout@
|
|
37
|
-
- uses: actions/setup-node@
|
|
36
|
+
- uses: actions/checkout@v3
|
|
37
|
+
- uses: actions/setup-node@v3.1.0
|
|
38
38
|
with:
|
|
39
39
|
node-version: 12
|
|
40
40
|
- run: npm ci
|
|
@@ -44,8 +44,8 @@ jobs:
|
|
|
44
44
|
needs: build
|
|
45
45
|
runs-on: ubuntu-latest
|
|
46
46
|
steps:
|
|
47
|
-
- uses: actions/checkout@
|
|
48
|
-
- uses: actions/setup-node@
|
|
47
|
+
- uses: actions/checkout@v3
|
|
48
|
+
- uses: actions/setup-node@v3.1.0
|
|
49
49
|
with:
|
|
50
50
|
node-version: 12
|
|
51
51
|
registry-url: https://registry.npmjs.org/
|
|
@@ -11,7 +11,7 @@ jobs:
|
|
|
11
11
|
|
|
12
12
|
steps:
|
|
13
13
|
- name: Checkout code
|
|
14
|
-
uses: actions/checkout@
|
|
14
|
+
uses: actions/checkout@v3
|
|
15
15
|
with:
|
|
16
16
|
ref: develop
|
|
17
17
|
|
|
@@ -32,8 +32,8 @@ jobs:
|
|
|
32
32
|
build:
|
|
33
33
|
runs-on: ubuntu-latest
|
|
34
34
|
steps:
|
|
35
|
-
- uses: actions/checkout@
|
|
36
|
-
- uses: actions/setup-node@
|
|
35
|
+
- uses: actions/checkout@v3
|
|
36
|
+
- uses: actions/setup-node@v3.1.0
|
|
37
37
|
with:
|
|
38
38
|
node-version: 12
|
|
39
39
|
- run: npm ci
|
|
@@ -43,8 +43,8 @@ jobs:
|
|
|
43
43
|
needs: build
|
|
44
44
|
runs-on: ubuntu-latest
|
|
45
45
|
steps:
|
|
46
|
-
- uses: actions/checkout@
|
|
47
|
-
- uses: actions/setup-node@
|
|
46
|
+
- uses: actions/checkout@v3
|
|
47
|
+
- uses: actions/setup-node@v3.1.0
|
|
48
48
|
with:
|
|
49
49
|
node-version: 12
|
|
50
50
|
registry-url: https://registry.npmjs.org/
|
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.
|
|
12
|
+
s.source = {:http => 'https://mobilesdk.useinsider.com/iOS/12.1.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.
|
|
17
|
+
s.dependency 'InsiderMobile', '12.1.0'
|
|
18
18
|
s.dependency 'InsiderHybrid', '1.1.2'
|
|
19
19
|
end
|
package/android/build.gradle
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
buildscript {
|
|
3
2
|
repositories {
|
|
4
3
|
jcenter()
|
|
@@ -9,7 +8,7 @@ buildscript {
|
|
|
9
8
|
}
|
|
10
9
|
|
|
11
10
|
dependencies {
|
|
12
|
-
classpath 'com.android.tools.build:gradle:
|
|
11
|
+
classpath 'com.android.tools.build:gradle:7.1.0'
|
|
13
12
|
}
|
|
14
13
|
}
|
|
15
14
|
|
|
@@ -36,18 +35,14 @@ android {
|
|
|
36
35
|
|
|
37
36
|
dependencies {
|
|
38
37
|
implementation "com.facebook.react:react-native:${getVersionFromPartner('reactNativeVersion', '+')}"
|
|
39
|
-
implementation ('com.useinsider:insider:13.0
|
|
38
|
+
implementation ('com.useinsider:insider:13.1.0-nh')
|
|
40
39
|
implementation ('com.useinsider:insiderhybrid:1.1.3')
|
|
41
40
|
|
|
42
|
-
implementation 'com.google.android.play:core:1.10.
|
|
41
|
+
implementation 'com.google.android.play:core:1.10.3'
|
|
43
42
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
|
44
|
-
implementation 'com.google.android.gms:play-services-location:
|
|
45
|
-
implementation 'com.google.
|
|
46
|
-
implementation 'com.google.
|
|
47
|
-
implementation 'androidx.lifecycle:lifecycle-process:2.
|
|
48
|
-
|
|
49
|
-
implementation 'com.huawei.hms:push:5.3.0.304'
|
|
50
|
-
implementation 'com.huawei.hms:ads-identifier:3.4.34.301'
|
|
51
|
-
implementation 'com.huawei.hms:location:4.0.4.300'
|
|
43
|
+
implementation 'com.google.android.gms:play-services-location:19.0.1'
|
|
44
|
+
implementation 'com.google.android.gms:play-services-ads:20.6.0'
|
|
45
|
+
implementation 'com.google.firebase:firebase-messaging:23.0.2'
|
|
46
|
+
implementation 'androidx.lifecycle:lifecycle-process:2.4.1'
|
|
52
47
|
|
|
53
48
|
}
|
|
@@ -223,6 +223,15 @@ public class RNInsiderModule extends ReactContextBaseJavaModule {
|
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
225
|
|
|
226
|
+
@ReactMethod
|
|
227
|
+
public void setWhatsappOptin(boolean whatsappOptin) {
|
|
228
|
+
try {
|
|
229
|
+
Insider.Instance.getCurrentUser().setWhatsappOptin(whatsappOptin);
|
|
230
|
+
} catch (Exception e) {
|
|
231
|
+
Insider.Instance.putException(e);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
226
235
|
@ReactMethod
|
|
227
236
|
public void login(ReadableMap identifiers) {
|
|
228
237
|
try {
|
|
@@ -592,10 +601,6 @@ public class RNInsiderModule extends ReactContextBaseJavaModule {
|
|
|
592
601
|
}
|
|
593
602
|
String provider = Insider.Instance.getCurrentProvider(reactContext);
|
|
594
603
|
switch (provider) {
|
|
595
|
-
case "huawei":
|
|
596
|
-
com.huawei.hms.push.RemoteMessage hmsRemoteMessage = new com.huawei.hms.push.RemoteMessage.Builder("insider").setData(remoteMessageStringMap).build();
|
|
597
|
-
Insider.Instance.handleHMSNotification(reactContext, hmsRemoteMessage);
|
|
598
|
-
break;
|
|
599
604
|
case "other":
|
|
600
605
|
case "google":
|
|
601
606
|
RemoteMessage fcmRemoteMessage = new RemoteMessage.Builder("insider").setData(remoteMessageStringMap).build();
|
package/index.js
CHANGED
|
@@ -155,6 +155,22 @@ export default class RNInsider {
|
|
|
155
155
|
Insider.putErrorLog(generateJSONErrorString(error));
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
|
+
|
|
159
|
+
static getMessageCenterDataArray(limit: number, startDate: Date, endDate: Date, callback: Function) {
|
|
160
|
+
if (shouldNotProceed() || limit == null || startDate == null || endDate == null || callback == null || startDate.getTime() === endDate.getTime() ||
|
|
161
|
+
startDate.getTime() > endDate.getTime()) return;
|
|
162
|
+
try {
|
|
163
|
+
Insider.getMessageCenterData(limit, startDate.toISOString(), endDate.toISOString(), (messageCenterData) => {
|
|
164
|
+
if (Platform.OS !== 'ios') {
|
|
165
|
+
callback(JSON.parse(messageCenterData || '[]'));
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
callback(messageCenterData.data);
|
|
169
|
+
});
|
|
170
|
+
} catch (error) {
|
|
171
|
+
Insider.putErrorLog(generateJSONErrorString(error));
|
|
172
|
+
}
|
|
173
|
+
}
|
|
158
174
|
|
|
159
175
|
static getSmartRecommendation(recommendationID: number, locale: string, currency: string, callback: Function) {
|
|
160
176
|
if (shouldNotProceed() || recommendationID == null || locale == null || currency == null || callback == null) return;
|
|
@@ -245,14 +261,14 @@ export default class RNInsider {
|
|
|
245
261
|
|
|
246
262
|
static visitCartPage(products: Array<RNInsiderProduct>) {
|
|
247
263
|
if (shouldNotProceed() || products == null) return;
|
|
248
|
-
let productMap = {};
|
|
249
264
|
let mappedProducts = new Array(products.length);
|
|
250
265
|
try {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
266
|
+
products.forEach((product, i) => {
|
|
267
|
+
let productMap = {};
|
|
268
|
+
productMap['productMustMap'] = product.productMustMap;
|
|
269
|
+
productMap['productOptMap'] = product.productOptMap;
|
|
270
|
+
mappedProducts[i] = productMap;
|
|
271
|
+
});
|
|
256
272
|
Insider.visitCartPage(mappedProducts);
|
|
257
273
|
} catch (error) {
|
|
258
274
|
Insider.putErrorLog(generateJSONErrorString(error));
|
|
@@ -152,6 +152,14 @@ RCT_EXPORT_METHOD(setLocationOptin:(BOOL)value) {
|
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
+
RCT_EXPORT_METHOD(setWhatsappOptin:(BOOL)value) {
|
|
156
|
+
@try {
|
|
157
|
+
[Insider getCurrentUser].setWhatsappOptin(value);
|
|
158
|
+
} @catch (NSException *e) {
|
|
159
|
+
[Insider sendError:e desc:[NSString stringWithFormat:@"%s:%d", __func__, __LINE__]];
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
155
163
|
RCT_EXPORT_METHOD(login:(NSDictionary *)identifiers) {
|
|
156
164
|
@try {
|
|
157
165
|
if (!identifiers) return;
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
2
|
+
"name": "react-native-insider",
|
|
3
|
+
"version": "5.0.2-nh",
|
|
4
|
+
"description": "React Native Insider SDK",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"react-native",
|
|
8
|
+
"ios",
|
|
9
|
+
"android",
|
|
10
|
+
"notifications",
|
|
11
|
+
"push",
|
|
12
|
+
"apns",
|
|
13
|
+
"fcm",
|
|
14
|
+
"insider"
|
|
15
|
+
],
|
|
16
|
+
"author": "insidermobile",
|
|
17
|
+
"homepage": "https://github.com/useinsider/react-native-insider"
|
|
18
18
|
}
|
package/src/InsiderUser.js
CHANGED
|
@@ -4,257 +4,267 @@ import RNInsiderIdentifier from 'react-native-insider/src/InsiderIdentifier';
|
|
|
4
4
|
const Insider = NativeModules.RNInsider;
|
|
5
5
|
|
|
6
6
|
function shouldNotProceed() {
|
|
7
|
-
|
|
7
|
+
return Insider == null;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
function generateJSONErrorString(error) {
|
|
11
|
-
|
|
11
|
+
return '[JavaScript Error] ' + error;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export default class RNInsiderUser {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
setGender(value: number) {
|
|
16
|
+
if (shouldNotProceed() || value == null) return this;
|
|
17
|
+
try {
|
|
18
|
+
Insider.setGender(value);
|
|
19
|
+
} catch (error) {
|
|
20
|
+
Insider.putErrorLog(generateJSONErrorString(error));
|
|
21
|
+
}
|
|
22
|
+
return this;
|
|
21
23
|
}
|
|
22
|
-
return this;
|
|
23
|
-
}
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
setBirthday(value: Date) {
|
|
26
|
+
if (shouldNotProceed() || value == null) return this;
|
|
27
|
+
try {
|
|
28
|
+
Insider.setBirthday(value.toISOString());
|
|
29
|
+
} catch (error) {
|
|
30
|
+
Insider.putErrorLog(generateJSONErrorString(error));
|
|
31
|
+
}
|
|
32
|
+
return this;
|
|
31
33
|
}
|
|
32
|
-
return this;
|
|
33
|
-
}
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
setName(value: string) {
|
|
36
|
+
if (shouldNotProceed() || value == null) return this;
|
|
37
|
+
try {
|
|
38
|
+
Insider.setName(value);
|
|
39
|
+
} catch (error) {
|
|
40
|
+
Insider.putErrorLog(generateJSONErrorString(error));
|
|
41
|
+
}
|
|
42
|
+
return this;
|
|
41
43
|
}
|
|
42
|
-
return this;
|
|
43
|
-
}
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
setSurname(value: string) {
|
|
46
|
+
if (shouldNotProceed() || value == null) return this;
|
|
47
|
+
try {
|
|
48
|
+
Insider.setSurname(value);
|
|
49
|
+
} catch (error) {
|
|
50
|
+
Insider.putErrorLog(generateJSONErrorString(error));
|
|
51
|
+
}
|
|
52
|
+
return this;
|
|
51
53
|
}
|
|
52
|
-
return this;
|
|
53
|
-
}
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
55
|
+
setAge(value: number) {
|
|
56
|
+
if (shouldNotProceed() || value == null) return this;
|
|
57
|
+
try {
|
|
58
|
+
Insider.setAge(value);
|
|
59
|
+
} catch (error) {
|
|
60
|
+
Insider.putErrorLog(generateJSONErrorString(error));
|
|
61
|
+
}
|
|
62
|
+
return this;
|
|
61
63
|
}
|
|
62
|
-
return this;
|
|
63
|
-
}
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
65
|
+
// setEmail(value: string) {
|
|
66
|
+
// if (shouldNotProceed() || value == null) return this;
|
|
67
|
+
// try {
|
|
68
|
+
// Insider.setEmail(value);
|
|
69
|
+
// } catch (error) {
|
|
70
|
+
// Insider.putErrorLog(generateJSONErrorString(error));
|
|
71
|
+
// }
|
|
72
|
+
// return this;
|
|
73
|
+
// }
|
|
74
74
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
75
|
+
// setPhoneNumber(value: string) {
|
|
76
|
+
// if (shouldNotProceed() || value == null) return this;
|
|
77
|
+
// try {
|
|
78
|
+
// Insider.setPhoneNumber(value);
|
|
79
|
+
// } catch (error) {
|
|
80
|
+
// Insider.putErrorLog(generateJSONErrorString(error));
|
|
81
|
+
// }
|
|
82
|
+
// return this;
|
|
83
|
+
// }
|
|
84
84
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
85
|
+
setLanguage(value: string) {
|
|
86
|
+
if (shouldNotProceed() || value == null) return this;
|
|
87
|
+
try {
|
|
88
|
+
Insider.setLanguage(value);
|
|
89
|
+
} catch (error) {
|
|
90
|
+
Insider.putErrorLog(generateJSONErrorString(error));
|
|
91
|
+
}
|
|
92
|
+
return this;
|
|
91
93
|
}
|
|
92
|
-
return this;
|
|
93
|
-
}
|
|
94
94
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
95
|
+
setLocale(value: string) {
|
|
96
|
+
if (shouldNotProceed() || value == null) return this;
|
|
97
|
+
try {
|
|
98
|
+
Insider.setLocale(value);
|
|
99
|
+
} catch (error) {
|
|
100
|
+
Insider.putErrorLog(generateJSONErrorString(error));
|
|
101
|
+
}
|
|
102
|
+
return this;
|
|
101
103
|
}
|
|
102
|
-
return this;
|
|
103
|
-
}
|
|
104
104
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
105
|
+
setFacebookID(value: string) {
|
|
106
|
+
if (shouldNotProceed() || value == null) return this;
|
|
107
|
+
try {
|
|
108
|
+
Insider.setFacebookID(value);
|
|
109
|
+
} catch (error) {
|
|
110
|
+
Insider.putErrorLog(generateJSONErrorString(error));
|
|
111
|
+
}
|
|
112
|
+
return this;
|
|
111
113
|
}
|
|
112
|
-
return this;
|
|
113
|
-
}
|
|
114
114
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
115
|
+
setTwitterID(value: string) {
|
|
116
|
+
if (shouldNotProceed() || value == null) return this;
|
|
117
|
+
try {
|
|
118
|
+
Insider.setTwitterID(value);
|
|
119
|
+
} catch (error) {
|
|
120
|
+
Insider.putErrorLog(generateJSONErrorString(error));
|
|
121
|
+
}
|
|
122
|
+
return this;
|
|
121
123
|
}
|
|
122
|
-
return this;
|
|
123
|
-
}
|
|
124
124
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
125
|
+
setEmailOptin(value: boolean) {
|
|
126
|
+
if (shouldNotProceed() || value == null) return this;
|
|
127
|
+
try {
|
|
128
|
+
Insider.setEmailOptin(value);
|
|
129
|
+
} catch (error) {
|
|
130
|
+
Insider.putErrorLog(generateJSONErrorString(error));
|
|
131
|
+
}
|
|
132
|
+
return this;
|
|
131
133
|
}
|
|
132
|
-
return this;
|
|
133
|
-
}
|
|
134
134
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
135
|
+
setSMSOptin(value: boolean) {
|
|
136
|
+
if (shouldNotProceed() || value == null) return this;
|
|
137
|
+
try {
|
|
138
|
+
Insider.setSMSOptin(value);
|
|
139
|
+
} catch (error) {
|
|
140
|
+
Insider.putErrorLog(generateJSONErrorString(error));
|
|
141
|
+
}
|
|
142
|
+
return this;
|
|
141
143
|
}
|
|
142
|
-
return this;
|
|
143
|
-
}
|
|
144
144
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
145
|
+
setPushOptin(value: boolean) {
|
|
146
|
+
if (shouldNotProceed() || value == null) return this;
|
|
147
|
+
try {
|
|
148
|
+
Insider.setPushOptin(value);
|
|
149
|
+
} catch (error) {
|
|
150
|
+
Insider.putErrorLog(generateJSONErrorString(error));
|
|
151
|
+
}
|
|
152
|
+
return this;
|
|
151
153
|
}
|
|
152
|
-
return this;
|
|
153
|
-
}
|
|
154
154
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
155
|
+
setLocationOptin(value: boolean) {
|
|
156
|
+
if (shouldNotProceed() || value == null) return this;
|
|
157
|
+
try {
|
|
158
|
+
Insider.setLocationOptin(value);
|
|
159
|
+
} catch (error) {
|
|
160
|
+
Insider.putErrorLog(generateJSONErrorString(error));
|
|
161
|
+
}
|
|
162
|
+
return this;
|
|
161
163
|
}
|
|
162
|
-
return this;
|
|
163
|
-
}
|
|
164
164
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
165
|
+
setWhatsappOptin(value: boolean) {
|
|
166
|
+
if (shouldNotProceed() || value == null) return this;
|
|
167
|
+
try {
|
|
168
|
+
Insider.setWhatsappOptin(value);
|
|
169
|
+
} catch (error) {
|
|
170
|
+
Insider.putErrorLog(generateJSONErrorString(error));
|
|
171
|
+
}
|
|
172
|
+
return this;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
login(identifiers: RNInsiderIdentifier, insiderIDResult: Function) {
|
|
176
|
+
if (shouldNotProceed()) { return this; }
|
|
177
|
+
try {
|
|
178
|
+
if (insiderIDResult != null) {
|
|
179
|
+
Insider.loginWithReturningID(identifiers.identifiers, insiderIDResult);
|
|
170
180
|
|
|
171
|
-
|
|
172
|
-
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
173
183
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
184
|
+
Insider.login(identifiers.identifiers);
|
|
185
|
+
} catch (error) {
|
|
186
|
+
Insider.putErrorLog(generateJSONErrorString(error));
|
|
187
|
+
}
|
|
188
|
+
return this;
|
|
177
189
|
}
|
|
178
|
-
return this;
|
|
179
|
-
}
|
|
180
190
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
191
|
+
logout() {
|
|
192
|
+
if (shouldNotProceed()) return this;
|
|
193
|
+
try {
|
|
194
|
+
Insider.logout();
|
|
195
|
+
} catch (error) {
|
|
196
|
+
Insider.putErrorLog(generateJSONErrorString(error));
|
|
197
|
+
}
|
|
198
|
+
return this;
|
|
187
199
|
}
|
|
188
|
-
return this;
|
|
189
|
-
}
|
|
190
200
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
201
|
+
setCustomAttributeWithString(key: string, value: string) {
|
|
202
|
+
if (shouldNotProceed() || key == null || value == null) return this;
|
|
203
|
+
try {
|
|
204
|
+
Insider.setCustomAttributeWithString(key, value);
|
|
205
|
+
} catch (error) {
|
|
206
|
+
Insider.putErrorLog(generateJSONErrorString(error));
|
|
207
|
+
}
|
|
208
|
+
return this;
|
|
197
209
|
}
|
|
198
|
-
return this;
|
|
199
|
-
}
|
|
200
210
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
211
|
+
setCustomAttributeWithInt(key: string, value: number) {
|
|
212
|
+
if (shouldNotProceed() || key == null || value == null) return this;
|
|
213
|
+
try {
|
|
214
|
+
Insider.setCustomAttributeWithInt(key, value);
|
|
215
|
+
} catch (error) {
|
|
216
|
+
Insider.putErrorLog(generateJSONErrorString(error));
|
|
217
|
+
}
|
|
218
|
+
return this;
|
|
207
219
|
}
|
|
208
|
-
return this;
|
|
209
|
-
}
|
|
210
220
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
221
|
+
setCustomAttributeWithDouble(key: string, value: number) {
|
|
222
|
+
if (shouldNotProceed() || key == null || value == null) return this;
|
|
223
|
+
try {
|
|
224
|
+
Insider.setCustomAttributeWithDouble(key, value);
|
|
225
|
+
} catch (error) {
|
|
226
|
+
Insider.putErrorLog(generateJSONErrorString(error));
|
|
227
|
+
}
|
|
228
|
+
return this;
|
|
217
229
|
}
|
|
218
|
-
return this;
|
|
219
|
-
}
|
|
220
230
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
231
|
+
setCustomAttributeWithBoolean(key: string, value: boolean) {
|
|
232
|
+
if (shouldNotProceed() || key == null || value == null) return this;
|
|
233
|
+
try {
|
|
234
|
+
Insider.setCustomAttributeWithBoolean(key, value);
|
|
235
|
+
} catch (error) {
|
|
236
|
+
Insider.putErrorLog(generateJSONErrorString(error));
|
|
237
|
+
}
|
|
238
|
+
return this;
|
|
227
239
|
}
|
|
228
|
-
return this;
|
|
229
|
-
}
|
|
230
240
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
241
|
+
setCustomAttributeWithDate(key: string, value: Date) {
|
|
242
|
+
if (shouldNotProceed() || key == null || value == null) return this;
|
|
243
|
+
try {
|
|
244
|
+
Insider.setCustomAttributeWithDate(key, value.toISOString());
|
|
245
|
+
} catch (error) {
|
|
246
|
+
Insider.putErrorLog(generateJSONErrorString(error));
|
|
247
|
+
}
|
|
248
|
+
return this;
|
|
237
249
|
}
|
|
238
|
-
return this;
|
|
239
|
-
}
|
|
240
250
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
251
|
+
setCustomAttributeWithArray(key: string, value: string[]) {
|
|
252
|
+
if (shouldNotProceed() || key == null || value == null) return this;
|
|
253
|
+
try {
|
|
254
|
+
Insider.setCustomAttributeWithArray(key, value);
|
|
255
|
+
} catch (error) {
|
|
256
|
+
Insider.putErrorLog(generateJSONErrorString(error));
|
|
257
|
+
}
|
|
258
|
+
return this;
|
|
247
259
|
}
|
|
248
|
-
return this;
|
|
249
|
-
}
|
|
250
260
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
261
|
+
unsetCustomAttribute(key: string) {
|
|
262
|
+
if (shouldNotProceed() || key == null) return this;
|
|
263
|
+
try {
|
|
264
|
+
Insider.unsetCustomAttribute(key);
|
|
265
|
+
} catch (error) {
|
|
266
|
+
Insider.putErrorLog(generateJSONErrorString(error));
|
|
267
|
+
}
|
|
268
|
+
return this;
|
|
257
269
|
}
|
|
258
|
-
|
|
259
|
-
}
|
|
260
|
-
}
|
|
270
|
+
}
|