cordova-plugin-insider 1.7.0 → 1.9.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/package.json +1 -1
- package/plugin.xml +3 -3
- package/src/android/InsiderPlugin.java +4 -0
- package/src/android/build-extras.gradle +1 -1
- package/src/ios/InsiderPlugin.h +1 -0
- package/src/ios/InsiderPlugin.m +37 -21
- package/types/InsiderPlugin.d.ts +1 -1
- package/www/Constants.js +4 -2
- package/www/InsiderPlugin.js +17 -3
package/package.json
CHANGED
package/plugin.xml
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<?xml version='1.0' encoding='utf-8'?>
|
|
2
|
-
<plugin id="cordova-plugin-insider" version="1.
|
|
2
|
+
<plugin id="cordova-plugin-insider" version="1.9.0" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
|
|
3
3
|
<name>Insider</name>
|
|
4
4
|
<description>Insider Cordova Plugin</description>
|
|
5
5
|
<keywords>insider,cordova,cordova-ios,cordova-android</keywords>
|
|
@@ -70,8 +70,8 @@
|
|
|
70
70
|
<source url="https://cdn.cocoapods.org/" />
|
|
71
71
|
</config>
|
|
72
72
|
<pods use-frameworks="true">
|
|
73
|
-
<pod name="InsiderMobile" spec="
|
|
74
|
-
<pod name="InsiderGeofence" spec="1.0
|
|
73
|
+
<pod name="InsiderMobile" spec="13.3.1" />
|
|
74
|
+
<pod name="InsiderGeofence" spec="1.1.0" />
|
|
75
75
|
<pod name="InsiderHybrid" spec="1.4.0" />
|
|
76
76
|
</pods>
|
|
77
77
|
</podspec>
|
|
@@ -112,6 +112,8 @@ public class InsiderPlugin extends CordovaPlugin {
|
|
|
112
112
|
Insider.Instance.setCustomEndpoint(args.getString(3));
|
|
113
113
|
|
|
114
114
|
init(args.getString(0), args.getString(1));
|
|
115
|
+
} else if (action.equals("reinitWithPartnerName")) {
|
|
116
|
+
Insider.Instance.reinitWithPartnerName(args.getString(0));
|
|
115
117
|
} else if (action.equals("setGDPRConsent")) {
|
|
116
118
|
Insider.Instance.setGDPRConsent(Boolean.parseBoolean(args.getString(0)));
|
|
117
119
|
} else if (action.equals("startTrackingGeofence")) {
|
|
@@ -635,6 +637,8 @@ public class InsiderPlugin extends CordovaPlugin {
|
|
|
635
637
|
return true;
|
|
636
638
|
} else if (action.equals("signUpConfirmation")) {
|
|
637
639
|
Insider.Instance.signUpConfirmation();
|
|
640
|
+
} else if (action.equals("setPushToken")) {
|
|
641
|
+
Insider.Instance.setPushToken(args.getString(0));
|
|
638
642
|
} else {
|
|
639
643
|
return false;
|
|
640
644
|
}
|
|
@@ -16,7 +16,7 @@ android {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
dependencies {
|
|
19
|
-
implementation 'com.useinsider:insider:14.
|
|
19
|
+
implementation 'com.useinsider:insider:14.1.2'
|
|
20
20
|
implementation 'com.useinsider:insiderhybrid:1.1.6'
|
|
21
21
|
|
|
22
22
|
implementation 'com.fasterxml.jackson.core:jackson-core:2.12.4'
|
package/src/ios/InsiderPlugin.h
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
- (void) init:(CDVInvokedUrlCommand *)command;
|
|
11
11
|
- (void) initWithLaunchOptions:(CDVInvokedUrlCommand *)command;
|
|
12
|
+
- (void) reinitWithPartnerName:(CDVInvokedUrlCommand *)command;
|
|
12
13
|
- (void) registerWithQuietPermission:(CDVInvokedUrlCommand *)command;
|
|
13
14
|
- (void) enableIDFACollection:(CDVInvokedUrlCommand *)command;
|
|
14
15
|
- (void) setGDPRConsent:(CDVInvokedUrlCommand *)command;
|
package/src/ios/InsiderPlugin.m
CHANGED
|
@@ -15,12 +15,13 @@
|
|
|
15
15
|
@try {
|
|
16
16
|
if (![command.arguments objectAtIndex:0] || ![command.arguments objectAtIndex:1] || ![command.arguments objectAtIndex:2])
|
|
17
17
|
return;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
|
|
19
|
+
NSString* partnerName = [[command arguments] objectAtIndex:0];
|
|
20
|
+
NSString* appGroup = [[command arguments] objectAtIndex:1];
|
|
21
|
+
|
|
22
|
+
[Insider initWithLaunchOptions:nil partnerName:partnerName appGroup:appGroup];
|
|
23
|
+
|
|
24
|
+
[self sendSuccessResultWithString:@"Insider Cordova Plugin: Initialized" andCommand:command];
|
|
24
25
|
} @catch (NSException *exception) {
|
|
25
26
|
[Insider sendError:exception desc:@"Insider.m - init"];
|
|
26
27
|
}
|
|
@@ -32,13 +33,12 @@
|
|
|
32
33
|
if (![command.arguments objectAtIndex:0] || ![command.arguments objectAtIndex:1] || ![command.arguments objectAtIndex:2])
|
|
33
34
|
return;
|
|
34
35
|
|
|
35
|
-
[self
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}];
|
|
36
|
+
[Insider registerInsiderCallbackWithSelector:@selector(registerCallback:) sender:self];
|
|
37
|
+
[Insider setHybridSDKVersion:[command.arguments objectAtIndex:1]];
|
|
38
|
+
[Insider initWithLaunchOptions:nil partnerName:[command.arguments objectAtIndex:0] appGroup:[command.arguments objectAtIndex:2]];
|
|
39
|
+
[Insider hybridApplicationDidBecomeActive];
|
|
40
|
+
|
|
41
|
+
[self sendSuccessResultWithString:@"Insider Cordova Plugin: initWithLaunchOptions" andCommand:command];
|
|
42
42
|
} @catch (NSException *exception){
|
|
43
43
|
[Insider sendError:exception desc:@"Insider Cordova Plugin - initWithLaunchOptions"];
|
|
44
44
|
}
|
|
@@ -49,19 +49,35 @@
|
|
|
49
49
|
if (![command.arguments objectAtIndex:0] || ![command.arguments objectAtIndex:1] || ![command.arguments objectAtIndex:2] || ![command.arguments objectAtIndex:3]) {
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
52
|
-
[self.commandDelegate runInBackground:^{
|
|
53
|
-
[Insider registerInsiderCallbackWithSelector:@selector(registerCallback:) sender:self];
|
|
54
|
-
[Insider setHybridSDKVersion:[command.arguments objectAtIndex:1]];
|
|
55
|
-
[Insider initWithLaunchOptions:nil partnerName:[command.arguments objectAtIndex:0] appGroup:[command.arguments objectAtIndex:2] customEndpoint:[command.arguments objectAtIndex:3]];
|
|
56
|
-
[Insider resumeSession];
|
|
57
|
-
[self sendSuccessResultWithString:@"Insider Cordova Plugin: initWithCustomEndpoint" andCommand:command];
|
|
58
|
-
}];
|
|
59
52
|
|
|
53
|
+
[Insider registerInsiderCallbackWithSelector:@selector(registerCallback:) sender:self];
|
|
54
|
+
[Insider setHybridSDKVersion:[command.arguments objectAtIndex:1]];
|
|
55
|
+
[Insider initWithLaunchOptions:nil partnerName:[command.arguments objectAtIndex:0] appGroup:[command.arguments objectAtIndex:2] customEndpoint:[command.arguments objectAtIndex:3]];
|
|
56
|
+
[Insider hybridApplicationDidBecomeActive];
|
|
57
|
+
|
|
58
|
+
[self sendSuccessResultWithString:@"Insider Cordova Plugin: initWithCustomEndpoint" andCommand:command];
|
|
60
59
|
} @catch (NSException *exception){
|
|
61
60
|
[Insider sendError:exception desc:@"Insider Cordova Plugin.m - initWithCustomEndpoint"];
|
|
62
61
|
}
|
|
63
62
|
}
|
|
64
63
|
|
|
64
|
+
- (void) reinitWithPartnerName:(CDVInvokedUrlCommand *)command {
|
|
65
|
+
@try {
|
|
66
|
+
if (![command.arguments objectAtIndex:0])
|
|
67
|
+
return;
|
|
68
|
+
|
|
69
|
+
[self.commandDelegate runInBackground:^{
|
|
70
|
+
NSString* partnerName = [[command arguments] objectAtIndex:0];
|
|
71
|
+
|
|
72
|
+
[Insider reinitWithPartnerName:partnerName];
|
|
73
|
+
|
|
74
|
+
[self sendSuccessResultWithString:@"Insider Cordova Plugin: Re-Initialized." andCommand:command];
|
|
75
|
+
}];
|
|
76
|
+
} @catch (NSException *exception) {
|
|
77
|
+
[Insider sendError:exception desc:@"Insider.m - init"];
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
65
81
|
-(void)registerCallback:(NSDictionary *)callbackDictionary {
|
|
66
82
|
@try {
|
|
67
83
|
if (!callbackDictionary || [callbackDictionary count] == 0)
|
|
@@ -229,7 +245,7 @@
|
|
|
229
245
|
- (void)hybridIntent:(CDVInvokedUrlCommand *)command {
|
|
230
246
|
@try {
|
|
231
247
|
[self.commandDelegate runInBackground:^{
|
|
232
|
-
[Insider
|
|
248
|
+
[Insider hybridApplicationDidBecomeActive];
|
|
233
249
|
}];
|
|
234
250
|
} @catch (NSException *e) {
|
|
235
251
|
[Insider sendError:e desc:[NSString stringWithFormat:@"%s:%d", __func__, __LINE__]];
|
package/types/InsiderPlugin.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ interface InsiderPlugin {
|
|
|
33
33
|
enableIDFACollection(idfaCollection: boolean): void;
|
|
34
34
|
removeInapp(): void;
|
|
35
35
|
registerWithQuietPermission(booleanValue: boolean): void;
|
|
36
|
-
|
|
36
|
+
setPushToken(token: string): void;
|
|
37
37
|
enableLocationCollection(locationCollection: boolean): void;
|
|
38
38
|
enableIpCollection(ipCollection: boolean): void;
|
|
39
39
|
enableCarrierCollection(carrierCollection: boolean): void;
|
package/www/Constants.js
CHANGED
|
@@ -55,7 +55,7 @@ module.exports = {
|
|
|
55
55
|
SET_GDPR_CONSENT: 'setGDPRConsent',
|
|
56
56
|
REMOVE_IN_APP: 'removeInapp',
|
|
57
57
|
REGISTER_WITH_QUIET_PERMISSION: 'registerWithQuietPermission',
|
|
58
|
-
SET_HYBRID_PUSH_TOKEN: '
|
|
58
|
+
SET_HYBRID_PUSH_TOKEN: 'setPushToken',
|
|
59
59
|
ENABLE_IDFA_COLLECTION: 'enableIDFACollection',
|
|
60
60
|
ENABLE_LOCATION_COLLECTION: 'enableLocationCollection',
|
|
61
61
|
ENABLE_IP_COLLECTION: 'enableIpCollection',
|
|
@@ -83,6 +83,8 @@ module.exports = {
|
|
|
83
83
|
// Platform
|
|
84
84
|
ANDROID: 'android',
|
|
85
85
|
IOS: 'ios',
|
|
86
|
+
// Reinit
|
|
87
|
+
REINIT_WITH_PARTNER_NAME: 'reinitWithPartnerName',
|
|
86
88
|
// SDK Version
|
|
87
|
-
SDK_VERSION: 'CDV-1.
|
|
89
|
+
SDK_VERSION: 'CDV-1.9.0',
|
|
88
90
|
};
|
package/www/InsiderPlugin.js
CHANGED
|
@@ -71,6 +71,20 @@ class InsiderPlugin {
|
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
+
reinitWithPartnerName = (partnerName) => {
|
|
75
|
+
if (Utils.checkParameters([
|
|
76
|
+
{ type: 'string', value: partnerName }])) {
|
|
77
|
+
Utils.showParameterWarningLog(this.constructor.name + '-reinit');
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
try {
|
|
82
|
+
Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.REINIT_WITH_PARTNER_NAME, [partnerName])
|
|
83
|
+
} catch (error) {
|
|
84
|
+
Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
|
|
74
88
|
getCurrentUser = () => {
|
|
75
89
|
try {
|
|
76
90
|
return this.insiderUser;
|
|
@@ -396,14 +410,14 @@ class InsiderPlugin {
|
|
|
396
410
|
}
|
|
397
411
|
};
|
|
398
412
|
|
|
399
|
-
|
|
413
|
+
setPushToken = (token) => {
|
|
400
414
|
if (Utils.checkParameters([{ type: 'string', value: token }])) {
|
|
401
|
-
Utils.showParameterWarningLog(this.constructor.name + '-
|
|
415
|
+
Utils.showParameterWarningLog(this.constructor.name + '-setPushToken');
|
|
402
416
|
return;
|
|
403
417
|
}
|
|
404
418
|
|
|
405
419
|
try {
|
|
406
|
-
if (
|
|
420
|
+
if (cordova.platformId !== InsiderConstants.ANDROID) return;
|
|
407
421
|
|
|
408
422
|
Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_HYBRID_PUSH_TOKEN, [token]);
|
|
409
423
|
} catch (error) {
|