react-native-insider 5.5.4 → 6.0.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 +2 -2
- package/android/build.gradle +2 -2
- package/index.js +30 -5
- package/ios/RNInsider/RNInsider.m +16 -0
- package/package.json +1 -1
package/RNInsider.podspec
CHANGED
|
@@ -9,12 +9,12 @@ 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/13.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', '13.0.0'
|
|
18
18
|
s.dependency 'InsiderGeofence', '1.0.3'
|
|
19
19
|
s.dependency 'InsiderHybrid', '1.4.0'
|
|
20
20
|
end
|
package/android/build.gradle
CHANGED
|
@@ -35,14 +35,14 @@ repositories {
|
|
|
35
35
|
|
|
36
36
|
dependencies {
|
|
37
37
|
implementation "com.facebook.react:react-native:${getVersionFromPartner('reactNativeVersion', '+')}"
|
|
38
|
-
implementation ('com.useinsider:insider:13.8.
|
|
38
|
+
implementation ('com.useinsider:insider:13.8.6')
|
|
39
39
|
implementation ('com.useinsider:insiderhybrid:1.1.5')
|
|
40
40
|
|
|
41
41
|
implementation "androidx.security:security-crypto:1.0.0"
|
|
42
42
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
|
43
43
|
implementation 'androidx.lifecycle:lifecycle-process:2.4.1'
|
|
44
44
|
|
|
45
|
-
implementation 'com.google.android.gms:play-services-location:
|
|
45
|
+
implementation 'com.google.android.gms:play-services-location:21.0.1'
|
|
46
46
|
implementation 'com.google.android.play:core-ktx:1.8.1'
|
|
47
47
|
implementation 'com.google.firebase:firebase-messaging:23.0.5'
|
|
48
48
|
|
package/index.js
CHANGED
|
@@ -19,6 +19,11 @@ const TEMP_STORE_CUSTOM_ACTION = 'TEMP_STORE_CUSTOM_ACTION';
|
|
|
19
19
|
const FOREGROUND_PUSH = 'FOREGROUND_PUSH';
|
|
20
20
|
const INAPP_SEEN = 'INAPP_SEEN';
|
|
21
21
|
|
|
22
|
+
const platformType = {
|
|
23
|
+
ios: "ios",
|
|
24
|
+
android: "android"
|
|
25
|
+
}
|
|
26
|
+
|
|
22
27
|
function shouldNotProceed() {
|
|
23
28
|
return Insider == null;
|
|
24
29
|
}
|
|
@@ -45,7 +50,7 @@ export default class RNInsider {
|
|
|
45
50
|
try {
|
|
46
51
|
registerInsiderCallback(insiderCallback);
|
|
47
52
|
let sdkVersion = 'RN-' + packageJSON.version;
|
|
48
|
-
if (Platform.OS ===
|
|
53
|
+
if (Platform.OS === platformType.ios) {
|
|
49
54
|
Insider.initWithLaunchOptions(null, partnerName, appGroup, sdkVersion);
|
|
50
55
|
} else {
|
|
51
56
|
Insider.init(partnerName, sdkVersion);
|
|
@@ -60,7 +65,7 @@ export default class RNInsider {
|
|
|
60
65
|
try {
|
|
61
66
|
registerInsiderCallback(insiderCallback);
|
|
62
67
|
let sdkVersion = 'RN-' + packageJSON.version;
|
|
63
|
-
if (Platform.OS ===
|
|
68
|
+
if (Platform.OS === platformType.ios) {
|
|
64
69
|
Insider.initWithCustomEndpoint(null, partnerName, appGroup, endpoint, sdkVersion);
|
|
65
70
|
} else {
|
|
66
71
|
Insider.init(partnerName, sdkVersion);
|
|
@@ -147,7 +152,7 @@ export default class RNInsider {
|
|
|
147
152
|
startDate.getTime() > endDate.getTime()) return;
|
|
148
153
|
try {
|
|
149
154
|
Insider.getMessageCenterData(limit, startDate.toISOString(), endDate.toISOString(), (messageCenterData) => {
|
|
150
|
-
if (Platform.OS !==
|
|
155
|
+
if (Platform.OS !== platformType.ios) {
|
|
151
156
|
callback(messageCenterData);
|
|
152
157
|
return;
|
|
153
158
|
}
|
|
@@ -163,7 +168,7 @@ export default class RNInsider {
|
|
|
163
168
|
startDate.getTime() > endDate.getTime()) return;
|
|
164
169
|
try {
|
|
165
170
|
Insider.getMessageCenterData(limit, startDate.toISOString(), endDate.toISOString(), (messageCenterData) => {
|
|
166
|
-
if (Platform.OS !==
|
|
171
|
+
if (Platform.OS !== platformType.ios) {
|
|
167
172
|
callback(JSON.parse(messageCenterData || '[]'));
|
|
168
173
|
return;
|
|
169
174
|
}
|
|
@@ -329,7 +334,7 @@ export default class RNInsider {
|
|
|
329
334
|
static registerWithQuietPermission(enabled) {
|
|
330
335
|
if (shouldNotProceed() || enabled == null) return;
|
|
331
336
|
try {
|
|
332
|
-
if (Platform.OS !==
|
|
337
|
+
if (Platform.OS !== platformType.ios) return;
|
|
333
338
|
Insider.registerWithQuietPermission(enabled);
|
|
334
339
|
} catch (error) {
|
|
335
340
|
Insider.putErrorLog(generateJSONErrorString(error));
|
|
@@ -395,6 +400,26 @@ export default class RNInsider {
|
|
|
395
400
|
}
|
|
396
401
|
}
|
|
397
402
|
|
|
403
|
+
static reenableTemplatesForIOS() {
|
|
404
|
+
if (shouldNotProceed() || Platform.OS !== platformType.ios) return;
|
|
405
|
+
|
|
406
|
+
try {
|
|
407
|
+
Insider.reenableTemplates();
|
|
408
|
+
} catch (error) {
|
|
409
|
+
Insider.putErrorLog(generateJSONErrorString(error));
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
static disableTemplatesForIOS() {
|
|
414
|
+
if (shouldNotProceed() || Platform.OS !== platformType.ios) return;
|
|
415
|
+
|
|
416
|
+
try {
|
|
417
|
+
Insider.disableTemplates();
|
|
418
|
+
} catch (error) {
|
|
419
|
+
Insider.putErrorLog(generateJSONErrorString(error));
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
|
|
398
423
|
static setForegroundPushCallback (callback) {
|
|
399
424
|
if (shouldNotProceed()) return;
|
|
400
425
|
|
|
@@ -534,6 +534,22 @@ RCT_EXPORT_METHOD(setActiveForegroundPushView) {
|
|
|
534
534
|
}
|
|
535
535
|
}
|
|
536
536
|
|
|
537
|
+
RCT_EXPORT_METHOD(disableTemplates:(NSString *)value) {
|
|
538
|
+
@try {
|
|
539
|
+
[Insider disableTemplates];
|
|
540
|
+
} @catch (NSException *e) {
|
|
541
|
+
[Insider sendError:e desc:[NSString stringWithFormat:@"%s:%d", __func__, __LINE__]];
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
RCT_EXPORT_METHOD(reenableTemplates:(NSString *)value) {
|
|
546
|
+
@try {
|
|
547
|
+
[Insider reenableTemplates];
|
|
548
|
+
} @catch (NSException *e) {
|
|
549
|
+
[Insider sendError:e desc:[NSString stringWithFormat:@"%s:%d", __func__, __LINE__]];
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
|
|
537
553
|
-(void)foregroundPushCallback:(UNNotification *) notification {
|
|
538
554
|
@try {
|
|
539
555
|
if (notification == nil) return;
|