react-native-radar 3.18.5 → 3.19.0-beta.2
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/android/build.gradle +1 -2
- package/android/src/main/java/io/radar/react/RNRadarModule.java +10 -0
- package/dist/@types/RadarNativeInterface.d.ts +2 -0
- package/dist/index.native.js +4 -0
- package/dist/index.web.d.ts +4 -0
- package/dist/index.web.js +10 -0
- package/ios/RNRadar.m +8 -0
- package/package.json +1 -1
- package/plugin/build/types.d.ts +1 -0
- package/plugin/build/withRadarAndroid.js +11 -2
- package/plugin/build/withRadarIOS.js +26 -0
- package/react-native-radar.podspec +2 -2
package/android/build.gradle
CHANGED
|
@@ -448,6 +448,16 @@ public class RNRadarModule extends ReactContextBaseJavaModule implements Permiss
|
|
|
448
448
|
Radar.getVerifiedLocationToken(trackCallback);
|
|
449
449
|
}
|
|
450
450
|
|
|
451
|
+
@ReactMethod
|
|
452
|
+
public void startVerifyServer() {
|
|
453
|
+
Radar.startVerifyServer();
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
@ReactMethod
|
|
457
|
+
public void stopVerifyServer() {
|
|
458
|
+
Radar.stopVerifyServer();
|
|
459
|
+
}
|
|
460
|
+
|
|
451
461
|
@ReactMethod
|
|
452
462
|
public void startTrackingEfficient() {
|
|
453
463
|
Radar.startTracking(RadarTrackingOptions.EFFICIENT);
|
|
@@ -15,6 +15,8 @@ export interface RadarNativeInterface {
|
|
|
15
15
|
trackOnce: (options?: RadarTrackOnceOptions | Location) => Promise<RadarTrackCallback>;
|
|
16
16
|
trackVerified: (options?: RadarTrackVerifiedOptions) => Promise<RadarTrackVerifiedCallback>;
|
|
17
17
|
getVerifiedLocationToken: () => Promise<RadarTrackVerifiedCallback>;
|
|
18
|
+
startVerifyServer: () => void;
|
|
19
|
+
stopVerifyServer: () => void;
|
|
18
20
|
startTrackingEfficient: () => void;
|
|
19
21
|
startTrackingResponsive: () => void;
|
|
20
22
|
startTrackingContinuous: () => void;
|
package/dist/index.native.js
CHANGED
|
@@ -40,6 +40,8 @@ const trackOnce = (options) => {
|
|
|
40
40
|
};
|
|
41
41
|
const trackVerified = (options) => react_native_1.NativeModules.RNRadar.trackVerified(options);
|
|
42
42
|
const getVerifiedLocationToken = () => react_native_1.NativeModules.RNRadar.getVerifiedLocationToken();
|
|
43
|
+
const startVerifyServer = () => react_native_1.NativeModules.RNRadar.startVerifyServer();
|
|
44
|
+
const stopVerifyServer = () => react_native_1.NativeModules.RNRadar.stopVerifyServer();
|
|
43
45
|
const startTrackingEfficient = () => react_native_1.NativeModules.RNRadar.startTrackingEfficient();
|
|
44
46
|
const startTrackingResponsive = () => react_native_1.NativeModules.RNRadar.startTrackingResponsive();
|
|
45
47
|
const startTrackingContinuous = () => react_native_1.NativeModules.RNRadar.startTrackingContinuous();
|
|
@@ -100,6 +102,8 @@ const Radar = {
|
|
|
100
102
|
trackOnce,
|
|
101
103
|
trackVerified,
|
|
102
104
|
getVerifiedLocationToken,
|
|
105
|
+
startVerifyServer,
|
|
106
|
+
stopVerifyServer,
|
|
103
107
|
startTrackingEfficient,
|
|
104
108
|
startTrackingResponsive,
|
|
105
109
|
startTrackingContinuous,
|
package/dist/index.web.d.ts
CHANGED
|
@@ -15,6 +15,8 @@ declare namespace Radar {
|
|
|
15
15
|
export { trackOnce };
|
|
16
16
|
export { trackVerified };
|
|
17
17
|
export { getVerifiedLocationToken };
|
|
18
|
+
export { startVerifyServer };
|
|
19
|
+
export { stopVerifyServer };
|
|
18
20
|
export { startTrackingEfficient };
|
|
19
21
|
export { startTrackingResponsive };
|
|
20
22
|
export { startTrackingContinuous };
|
|
@@ -71,6 +73,8 @@ declare function getLocation(): Promise<any>;
|
|
|
71
73
|
declare function trackOnce(options: any): Promise<any>;
|
|
72
74
|
declare function trackVerified(): Promise<any>;
|
|
73
75
|
declare function getVerifiedLocationToken(): Promise<any>;
|
|
76
|
+
declare function startVerifyServer(): void;
|
|
77
|
+
declare function stopVerifyServer(): void;
|
|
74
78
|
declare function startTrackingEfficient(): void;
|
|
75
79
|
declare function startTrackingResponsive(): void;
|
|
76
80
|
declare function startTrackingContinuous(): void;
|
package/dist/index.web.js
CHANGED
|
@@ -118,6 +118,14 @@ const getVerifiedLocationToken = () => {
|
|
|
118
118
|
throw new Error("getVerifiedLocationToken() is not implemented on web");
|
|
119
119
|
return new Promise((resolve, reject) => { reject("getVerifiedLocationToken() is not implemented on web"); });
|
|
120
120
|
};
|
|
121
|
+
const startVerifyServer = () => {
|
|
122
|
+
if (throws)
|
|
123
|
+
throw new Error("startVerifyServer() is not implemented on web");
|
|
124
|
+
};
|
|
125
|
+
const stopVerifyServer = () => {
|
|
126
|
+
if (throws)
|
|
127
|
+
throw new Error("stopVerifyServer() is not implemented on web");
|
|
128
|
+
};
|
|
121
129
|
const startTrackingEfficient = () => {
|
|
122
130
|
if (throws)
|
|
123
131
|
throw new Error("startTrackingEfficient() is not implemented on web");
|
|
@@ -471,6 +479,8 @@ const Radar = {
|
|
|
471
479
|
trackOnce,
|
|
472
480
|
trackVerified,
|
|
473
481
|
getVerifiedLocationToken,
|
|
482
|
+
startVerifyServer,
|
|
483
|
+
stopVerifyServer,
|
|
474
484
|
startTrackingEfficient,
|
|
475
485
|
startTrackingResponsive,
|
|
476
486
|
startTrackingContinuous,
|
package/ios/RNRadar.m
CHANGED
|
@@ -357,6 +357,14 @@ RCT_EXPORT_METHOD(getVerifiedLocationToken:(RCTPromiseResolveBlock)resolve rejec
|
|
|
357
357
|
[Radar getVerifiedLocationToken:completionHandler];
|
|
358
358
|
}
|
|
359
359
|
|
|
360
|
+
RCT_EXPORT_METHOD(startVerifyServer) {
|
|
361
|
+
[Radar startVerifyServer];
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
RCT_EXPORT_METHOD(stopVerifyServer) {
|
|
365
|
+
[Radar stopVerifyServer];
|
|
366
|
+
}
|
|
367
|
+
|
|
360
368
|
RCT_EXPORT_METHOD(startTrackingEfficient) {
|
|
361
369
|
[Radar startTrackingWithOptions:RadarTrackingOptions.presetEfficient];
|
|
362
370
|
}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "React Native module for Radar, the leading geofencing and location tracking platform",
|
|
4
4
|
"homepage": "https://radar.com",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
|
-
"version": "3.
|
|
6
|
+
"version": "3.19.0-beta.2",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"files": [
|
|
9
9
|
"/android",
|
package/plugin/build/types.d.ts
CHANGED
|
@@ -33,6 +33,7 @@ const withRadarAndroid = (config, args) => {
|
|
|
33
33
|
<!-- for React Native -->
|
|
34
34
|
<domain-config cleartextTrafficPermitted="true">
|
|
35
35
|
<domain includeSubdomains="true">localhost</domain>
|
|
36
|
+
<domain includeSubdomains="true">10.0.2.2</domain>
|
|
36
37
|
</domain-config>
|
|
37
38
|
|
|
38
39
|
<!-- for SSL pinning -->
|
|
@@ -51,7 +52,7 @@ const withRadarAndroid = (config, args) => {
|
|
|
51
52
|
]);
|
|
52
53
|
return (0, config_plugins_1.withAppBuildGradle)(config, (config) => {
|
|
53
54
|
if (config.modResults.language === "groovy") {
|
|
54
|
-
config.modResults.contents = modifyAppBuildGradle(config.modResults.contents, args.androidFraud ?? false);
|
|
55
|
+
config.modResults.contents = modifyAppBuildGradle(config.modResults.contents, args.androidFraud ?? false, args.addRadarSDKVerify ?? false);
|
|
55
56
|
}
|
|
56
57
|
else {
|
|
57
58
|
throw new Error("Cannot configure Sentry in the app gradle because the build.gradle is not groovy");
|
|
@@ -85,15 +86,19 @@ async function setCustomConfigAsync(config, androidManifest, args) {
|
|
|
85
86
|
}
|
|
86
87
|
return androidManifest;
|
|
87
88
|
}
|
|
88
|
-
function modifyAppBuildGradle(buildGradle, androidFraud) {
|
|
89
|
+
function modifyAppBuildGradle(buildGradle, androidFraud, addRadarSDKVerify) {
|
|
89
90
|
let hasLocationService = false;
|
|
90
91
|
let hasPlayIntegrity = false;
|
|
92
|
+
let hasNanoHTTPD = false;
|
|
91
93
|
if (buildGradle.includes('com.google.android.gms:play-services-location:21.0.1"')) {
|
|
92
94
|
hasLocationService = true;
|
|
93
95
|
}
|
|
94
96
|
if (buildGradle.includes('com.google.android.play:integrity:1.2.0"')) {
|
|
95
97
|
hasPlayIntegrity = true;
|
|
96
98
|
}
|
|
99
|
+
if (buildGradle.includes('org.nanohttpd:nanohttpd:2.3.1"')) {
|
|
100
|
+
hasNanoHTTPD = true;
|
|
101
|
+
}
|
|
97
102
|
const pattern = /^dependencies {/m;
|
|
98
103
|
if (!buildGradle.match(pattern)) {
|
|
99
104
|
config_plugins_1.WarningAggregator.addWarningAndroid("react-native-radar", "Could not find react.gradle script in android/app/build.gradle.");
|
|
@@ -106,5 +111,9 @@ function modifyAppBuildGradle(buildGradle, androidFraud) {
|
|
|
106
111
|
replacementString +=
|
|
107
112
|
"\n\n" + ' implementation "com.google.android.play:integrity:1.2.0"';
|
|
108
113
|
}
|
|
114
|
+
if (addRadarSDKVerify && !hasNanoHTTPD) {
|
|
115
|
+
replacementString +=
|
|
116
|
+
"\n\n" + ' implementation "org.nanohttpd:nanohttpd:2.3.1"';
|
|
117
|
+
}
|
|
109
118
|
return buildGradle.replace(pattern, (match) => match + replacementString);
|
|
110
119
|
}
|
|
@@ -70,6 +70,32 @@ const withRadarIOS = (config, args) => {
|
|
|
70
70
|
},
|
|
71
71
|
]);
|
|
72
72
|
}
|
|
73
|
+
if (args.addRadarSDKVerify) {
|
|
74
|
+
config = (0, config_plugins_1.withDangerousMod)(config, [
|
|
75
|
+
'ios',
|
|
76
|
+
async (config) => {
|
|
77
|
+
const filePath = path_1.default.join(config.modRequest.platformProjectRoot, 'Podfile');
|
|
78
|
+
const contents = await promises_1.default.readFile(filePath, 'utf-8');
|
|
79
|
+
// Check if the pod declaration already exists
|
|
80
|
+
if (contents.indexOf("pod 'RadarSDK/Verify', '3.19.2-beta.9'") === -1) {
|
|
81
|
+
// Find the target block
|
|
82
|
+
const targetRegex = /target '(\w+)' do/g;
|
|
83
|
+
const match = targetRegex.exec(contents);
|
|
84
|
+
if (match) {
|
|
85
|
+
const targetStartIndex = match.index;
|
|
86
|
+
const targetEndIndex = contents.indexOf('end', targetStartIndex) + 3;
|
|
87
|
+
// Insert the pod declaration within the target block
|
|
88
|
+
const targetBlock = contents.substring(targetStartIndex, targetEndIndex);
|
|
89
|
+
const updatedTargetBlock = targetBlock.replace(/(target '(\w+)' do)/, `$1\n pod 'RadarSDK/Verify', '3.19.2-beta.9'\n pod 'CocoaAsyncSocket', :modular_headers => true\n pod 'HTTPParserC', :modular_headers => true`);
|
|
90
|
+
const newContents = contents.replace(targetBlock, updatedTargetBlock);
|
|
91
|
+
// Write the updated contents back to the Podfile
|
|
92
|
+
await promises_1.default.writeFile(filePath, newContents);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return config;
|
|
96
|
+
},
|
|
97
|
+
]);
|
|
98
|
+
}
|
|
73
99
|
return config;
|
|
74
100
|
};
|
|
75
101
|
exports.withRadarIOS = withRadarIOS;
|
|
@@ -12,8 +12,8 @@ Pod::Spec.new do |s|
|
|
|
12
12
|
s.summary = package[:description]
|
|
13
13
|
s.source = { git: package[:repository][:url] }
|
|
14
14
|
s.source_files = "ios/*.{h,m}"
|
|
15
|
-
s.platform = :ios, "
|
|
15
|
+
s.platform = :ios, "12.0"
|
|
16
16
|
|
|
17
17
|
s.dependency "React"
|
|
18
|
-
s.dependency "RadarSDK", "~> 3.
|
|
18
|
+
s.dependency "RadarSDK", "~> 3.19.2-beta.9"
|
|
19
19
|
end
|