react-native-radar 3.20.4 → 3.21.0-beta.1
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/Radar.podspec +22 -0
- package/android/build.gradle +77 -35
- package/android/gradle.properties +5 -1
- package/android/src/main/AndroidManifest.xml +1 -3
- package/android/src/main/java/{io/radar/react/RNRadarModule.java → com/radar/RadarModuleImpl.java} +131 -258
- package/android/src/main/java/com/radar/RadarPackage.kt +35 -0
- package/android/src/main/java/{io/radar/react/RNRadarUtils.java → com/radar/RadarUtils.java} +3 -2
- package/android/src/newarch/java/com/radar/RadarModule.kt +381 -0
- package/android/src/oldarch/java/com/radar/RadarModule.java +416 -0
- package/android/src/{main/java/io/radar/react/RNRadarReceiver.java → oldarch/java/com/radar/RadarOldArchReceiver.java} +8 -8
- package/android/src/{main/java/io/radar/react/RNRadarVerifiedReceiver.java → oldarch/java/com/radar/RadarOldArchVerifiedReceiver.java} +4 -4
- package/app.plugin.js +1 -1
- package/ios/RNRadar.h +11 -2
- package/ios/{RNRadar.m → RNRadar.mm} +77 -39
- package/lib/commonjs/@types/RadarNativeInterface.js +2 -0
- package/lib/commonjs/@types/RadarNativeInterface.js.map +1 -0
- package/lib/commonjs/@types/types.js +2 -0
- package/lib/commonjs/@types/types.js.map +1 -0
- package/lib/commonjs/NativeRadar.js +2 -0
- package/lib/commonjs/NativeRadar.js.map +1 -0
- package/lib/commonjs/helpers.js +2 -0
- package/lib/commonjs/helpers.js.map +1 -0
- package/lib/commonjs/index.js +2 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/index.native.js +2 -0
- package/lib/commonjs/index.native.js.map +1 -0
- package/lib/commonjs/index.web.js +2 -0
- package/lib/commonjs/index.web.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/plugin/types.js +2 -0
- package/lib/commonjs/plugin/types.js.map +1 -0
- package/lib/commonjs/plugin/withRadar.js +2 -0
- package/lib/commonjs/plugin/withRadar.js.map +1 -0
- package/lib/commonjs/plugin/withRadarAndroid.js +2 -0
- package/lib/commonjs/plugin/withRadarAndroid.js.map +1 -0
- package/lib/commonjs/plugin/withRadarIOS.js +2 -0
- package/lib/commonjs/plugin/withRadarIOS.js.map +1 -0
- package/lib/commonjs/ui/autocomplete.js +2 -0
- package/lib/commonjs/ui/autocomplete.js.map +1 -0
- package/lib/commonjs/ui/images.js +2 -0
- package/lib/commonjs/ui/images.js.map +1 -0
- package/lib/commonjs/ui/map.js +2 -0
- package/lib/commonjs/ui/map.js.map +1 -0
- package/lib/commonjs/ui/styles.js +2 -0
- package/lib/commonjs/ui/styles.js.map +1 -0
- package/lib/commonjs/version.js +2 -0
- package/lib/commonjs/version.js.map +1 -0
- package/{dist → lib/typescript/src}/@types/RadarNativeInterface.d.ts +18 -7
- package/lib/typescript/src/@types/RadarNativeInterface.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/@types/types.d.ts +5 -3
- package/lib/typescript/src/@types/types.d.ts.map +1 -0
- package/lib/typescript/src/NativeRadar.d.ts +87 -0
- package/lib/typescript/src/NativeRadar.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/index.native.d.ts +7 -0
- package/lib/typescript/src/index.native.d.ts.map +1 -0
- package/lib/typescript/src/plugin/types.d.ts +13 -0
- package/lib/typescript/src/plugin/types.d.ts.map +1 -0
- package/{plugin/build → lib/typescript/src/plugin}/withRadar.d.ts +2 -1
- package/lib/typescript/src/plugin/withRadar.d.ts.map +1 -0
- package/{plugin/build → lib/typescript/src/plugin}/withRadarAndroid.d.ts +1 -0
- package/lib/typescript/src/plugin/withRadarAndroid.d.ts.map +1 -0
- package/{plugin/build → lib/typescript/src/plugin}/withRadarIOS.d.ts +1 -0
- package/lib/typescript/src/plugin/withRadarIOS.d.ts.map +1 -0
- package/lib/typescript/src/version.d.ts +2 -0
- package/lib/typescript/src/version.d.ts.map +1 -0
- package/package.json +85 -34
- package/react-native.config.js +10 -0
- package/src/@types/RadarNativeInterface.ts +127 -0
- package/src/@types/types.ts +808 -0
- package/src/NativeRadar.ts +95 -0
- package/src/helpers.js +11 -0
- package/src/index.native.ts +419 -0
- package/src/index.tsx +22 -0
- package/src/index.web.js +528 -0
- package/{plugin/build/types.d.ts → src/plugin/types.ts} +1 -1
- package/src/plugin/withRadar.ts +39 -0
- package/src/plugin/withRadarAndroid.ts +147 -0
- package/src/plugin/withRadarIOS.ts +80 -0
- package/src/ui/autocomplete.jsx +324 -0
- package/src/ui/back.png +0 -0
- package/src/ui/close.png +0 -0
- package/src/ui/images.js +5 -0
- package/src/ui/map-logo.png +0 -0
- package/src/ui/map.jsx +122 -0
- package/src/ui/marker.png +0 -0
- package/src/ui/radar-logo.png +0 -0
- package/src/ui/search.png +0 -0
- package/src/ui/styles.js +125 -0
- package/src/version.ts +3 -0
- package/android/build.gradle.template +0 -49
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +0 -6
- package/android/gradlew +0 -160
- package/android/gradlew.bat +0 -90
- package/android/proguard-rules.pro +0 -4
- package/android/src/main/java/io/radar/react/RNRadarPackage.java +0 -29
- package/dist/@types/RadarNativeInterface.js +0 -2
- package/dist/@types/types.js +0 -150
- package/dist/helpers.d.ts +0 -2
- package/dist/helpers.js +0 -11
- package/dist/index.js +0 -29
- package/dist/index.native.d.ts +0 -3
- package/dist/index.native.js +0 -150
- package/dist/index.web.d.ts +0 -113
- package/dist/index.web.js +0 -516
- package/dist/ui/autocomplete.d.ts +0 -5
- package/dist/ui/autocomplete.js +0 -206
- package/dist/ui/images.d.ts +0 -5
- package/dist/ui/images.js +0 -8
- package/dist/ui/map.d.ts +0 -6
- package/dist/ui/map.js +0 -122
- package/dist/ui/styles.d.ts +0 -172
- package/dist/ui/styles.js +0 -125
- package/ios/Cartfile.private +0 -1
- package/ios/Cartfile.resolved +0 -1
- package/ios/Cartfile.resolved.template +0 -1
- package/ios/RNRadar.xcodeproj/project.pbxproj +0 -521
- package/ios/RNRadar.xcodeproj/xcshareddata/xcschemes/RNRadar.xcscheme +0 -76
- package/plugin/build/index.d.ts +0 -3
- package/plugin/build/index.js +0 -6
- package/plugin/build/types.js +0 -2
- package/plugin/build/withRadar.js +0 -26
- package/plugin/build/withRadarAndroid.js +0 -98
- package/plugin/build/withRadarIOS.js +0 -76
- package/react-native-radar.podspec +0 -19
- /package/{dist → lib/commonjs}/ui/back.png +0 -0
- /package/{dist → lib/commonjs}/ui/close.png +0 -0
- /package/{dist → lib/commonjs}/ui/map-logo.png +0 -0
- /package/{dist → lib/commonjs}/ui/marker.png +0 -0
- /package/{dist → lib/commonjs}/ui/radar-logo.png +0 -0
- /package/{dist → lib/commonjs}/ui/search.png +0 -0
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.withRadarAndroid = void 0;
|
|
7
|
-
const config_plugins_1 = require("expo/config-plugins");
|
|
8
|
-
const fs_1 = __importDefault(require("fs"));
|
|
9
|
-
const path_1 = __importDefault(require("path"));
|
|
10
|
-
const withRadarAndroid = (config, args) => {
|
|
11
|
-
config = withAndroidPermissions(config, args);
|
|
12
|
-
config = (0, config_plugins_1.withDangerousMod)(config, [
|
|
13
|
-
"android",
|
|
14
|
-
async (config) => {
|
|
15
|
-
if (!args.androidFraud) {
|
|
16
|
-
return config;
|
|
17
|
-
}
|
|
18
|
-
// Get the path to the Android folder
|
|
19
|
-
const androidPath = path_1.default.join(config.modRequest.projectRoot, "android", "app", "src", "main", "res", "xml");
|
|
20
|
-
// Check if the directory exists, if not, create it
|
|
21
|
-
if (!fs_1.default.existsSync(androidPath)) {
|
|
22
|
-
fs_1.default.mkdirSync(androidPath, { recursive: true });
|
|
23
|
-
}
|
|
24
|
-
// Create the path to the new file
|
|
25
|
-
const newFilePath = path_1.default.join(androidPath, "network_security_config.xml");
|
|
26
|
-
// Define xml content
|
|
27
|
-
const xml = `<?xml version="1.0" encoding="utf-8"?>
|
|
28
|
-
<network-security-config>
|
|
29
|
-
<!-- for React Native -->
|
|
30
|
-
<domain-config cleartextTrafficPermitted="true">
|
|
31
|
-
<domain includeSubdomains="true">localhost</domain>
|
|
32
|
-
</domain-config>
|
|
33
|
-
|
|
34
|
-
<!-- for SSL pinning -->
|
|
35
|
-
<domain-config cleartextTrafficPermitted="false">
|
|
36
|
-
<domain includeSubdomains="true">api-verified.radar.io</domain>
|
|
37
|
-
<pin-set>
|
|
38
|
-
<pin digest="SHA-256">15ktYXSSU2llpy7YyCgeqUKDBkjcimK/weUcec960sI=</pin>
|
|
39
|
-
<pin digest="SHA-256">15ktYXSSU2llpy7YyCgeqUKDBkjcimK/weUcec960sI=</pin>
|
|
40
|
-
</pin-set>
|
|
41
|
-
</domain-config>
|
|
42
|
-
</network-security-config>`;
|
|
43
|
-
// Write to the new file
|
|
44
|
-
fs_1.default.writeFileSync(newFilePath, xml);
|
|
45
|
-
return config;
|
|
46
|
-
},
|
|
47
|
-
]);
|
|
48
|
-
return (0, config_plugins_1.withAppBuildGradle)(config, (config) => {
|
|
49
|
-
if (config.modResults.language === "groovy") {
|
|
50
|
-
config.modResults.contents = modifyAppBuildGradle(config.modResults.contents, args.androidFraud ?? false);
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
throw new Error("Cannot configure Sentry in the app gradle because the build.gradle is not groovy");
|
|
54
|
-
}
|
|
55
|
-
return config;
|
|
56
|
-
});
|
|
57
|
-
};
|
|
58
|
-
exports.withRadarAndroid = withRadarAndroid;
|
|
59
|
-
function withAndroidPermissions(config, args) {
|
|
60
|
-
const isAndroidBackgroundLocationEnabled = !!args.androidBackgroundPermission;
|
|
61
|
-
const enableAndroidForegroundService = !!args.androidForegroundService;
|
|
62
|
-
const enableAndroidActivityRecognition = !!args.androidActivityRecognition;
|
|
63
|
-
return config_plugins_1.AndroidConfig.Permissions.withPermissions(config, [
|
|
64
|
-
isAndroidBackgroundLocationEnabled &&
|
|
65
|
-
"android.permission.ACCESS_BACKGROUND_LOCATION",
|
|
66
|
-
enableAndroidForegroundService && "android.permission.FOREGROUND_SERVICE",
|
|
67
|
-
enableAndroidForegroundService &&
|
|
68
|
-
"android.permission.FOREGROUND_SERVICE_LOCATION",
|
|
69
|
-
enableAndroidActivityRecognition &&
|
|
70
|
-
"android.permission.ACTIVITY_RECOGNITION",
|
|
71
|
-
].filter(Boolean));
|
|
72
|
-
}
|
|
73
|
-
function modifyAppBuildGradle(buildGradle, androidFraud) {
|
|
74
|
-
let hasLocationService = false;
|
|
75
|
-
let hasPlayIntegrity = false;
|
|
76
|
-
if (buildGradle.includes('com.google.android.gms:play-services-location:21.0.1"')) {
|
|
77
|
-
hasLocationService = true;
|
|
78
|
-
}
|
|
79
|
-
if (buildGradle.includes('com.google.android.play:integrity:1.2.0"')) {
|
|
80
|
-
hasPlayIntegrity = true;
|
|
81
|
-
}
|
|
82
|
-
const pattern = /^dependencies {/m;
|
|
83
|
-
if (!buildGradle.match(pattern)) {
|
|
84
|
-
throw new Error(`Failed to find react.gradle script in android/app/build.gradle.
|
|
85
|
-
This is required for react-native-radar to function properly.
|
|
86
|
-
Please ensure your android/app/build.gradle includes the react.gradle script.
|
|
87
|
-
Current build.gradle content: ${buildGradle}`);
|
|
88
|
-
}
|
|
89
|
-
let replacementString = "\n\n" +
|
|
90
|
-
(!hasLocationService
|
|
91
|
-
? ' implementation "com.google.android.gms:play-services-location:21.0.1"'
|
|
92
|
-
: "");
|
|
93
|
-
if (androidFraud && !hasPlayIntegrity) {
|
|
94
|
-
replacementString +=
|
|
95
|
-
"\n\n" + ' implementation "com.google.android.play:integrity:1.2.0"';
|
|
96
|
-
}
|
|
97
|
-
return buildGradle.replace(pattern, (match) => match + replacementString);
|
|
98
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.withRadarIOS = void 0;
|
|
7
|
-
const config_plugins_1 = require("expo/config-plugins");
|
|
8
|
-
const promises_1 = __importDefault(require("fs/promises"));
|
|
9
|
-
const path_1 = __importDefault(require("path"));
|
|
10
|
-
const withRadarIOS = (config, args) => {
|
|
11
|
-
config = (0, config_plugins_1.withInfoPlist)(config, (config) => {
|
|
12
|
-
config.modResults.NSLocationWhenInUseUsageDescription =
|
|
13
|
-
args.iosNSLocationWhenInUseUsageDescription ??
|
|
14
|
-
"This app uses the location service to provide location-based services.";
|
|
15
|
-
if (args.iosNSLocationAlwaysAndWhenInUseUsageDescription) {
|
|
16
|
-
config.modResults.NSLocationAlwaysAndWhenInUseUsageDescription =
|
|
17
|
-
args.iosNSLocationAlwaysAndWhenInUseUsageDescription;
|
|
18
|
-
}
|
|
19
|
-
if (args.iosBackgroundMode) {
|
|
20
|
-
config.modResults.UIBackgroundModes = ["location", "fetch"];
|
|
21
|
-
}
|
|
22
|
-
if (args.iosFraud) {
|
|
23
|
-
config.modResults.NSAppTransportSecurity = {
|
|
24
|
-
NSAllowsArbitraryLoads: false,
|
|
25
|
-
NSPinnedDomains: {
|
|
26
|
-
"api-verified.radar.io": {
|
|
27
|
-
NSIncludesSubdomains: true,
|
|
28
|
-
NSPinnedLeafIdentities: [
|
|
29
|
-
{
|
|
30
|
-
"SPKI-SHA256-BASE64": "15ktYXSSU2llpy7YyCgeqUKDBkjcimK/weUcec960sI=",
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"SPKI-SHA256-BASE64": "15ktYXSSU2llpy7YyCgeqUKDBkjcimK/weUcec960sI=",
|
|
34
|
-
},
|
|
35
|
-
],
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
if (args.addRadarSDKMotion) {
|
|
41
|
-
config.modResults.NSMotionUsageDescription =
|
|
42
|
-
args.iosNSMotionUsageDescription ??
|
|
43
|
-
"This app uses the motion service to provide motion-based services.";
|
|
44
|
-
}
|
|
45
|
-
return config;
|
|
46
|
-
});
|
|
47
|
-
if (args.addRadarSDKMotion) {
|
|
48
|
-
config = (0, config_plugins_1.withDangerousMod)(config, [
|
|
49
|
-
'ios',
|
|
50
|
-
async (config) => {
|
|
51
|
-
const filePath = path_1.default.join(config.modRequest.platformProjectRoot, 'Podfile');
|
|
52
|
-
const contents = await promises_1.default.readFile(filePath, 'utf-8');
|
|
53
|
-
// Check if the pod declaration already exists
|
|
54
|
-
if (contents.indexOf("pod 'RadarSDKMotion', '3.20.1'") === -1) {
|
|
55
|
-
// Find the target block
|
|
56
|
-
const targetRegex = /target '(\w+)' do/g;
|
|
57
|
-
const match = targetRegex.exec(contents);
|
|
58
|
-
if (match) {
|
|
59
|
-
const targetStartIndex = match.index;
|
|
60
|
-
const targetEndIndex = contents.indexOf('end', targetStartIndex) + 3;
|
|
61
|
-
// Insert the pod declaration within the target block
|
|
62
|
-
const targetBlock = contents.substring(targetStartIndex, targetEndIndex);
|
|
63
|
-
// Just for this version of the SDK, we will be using 3.21.1 of the SDKMotion pod. There is no difference between the source code of 3.21.2 and 3.21.1 for RadarSDKMotion.
|
|
64
|
-
const updatedTargetBlock = targetBlock.replace(/(target '(\w+)' do)/, `$1\n pod 'RadarSDKMotion', '3.20.1'`);
|
|
65
|
-
const newContents = contents.replace(targetBlock, updatedTargetBlock);
|
|
66
|
-
// Write the updated contents back to the Podfile
|
|
67
|
-
await promises_1.default.writeFile(filePath, newContents);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return config;
|
|
71
|
-
},
|
|
72
|
-
]);
|
|
73
|
-
}
|
|
74
|
-
return config;
|
|
75
|
-
};
|
|
76
|
-
exports.withRadarIOS = withRadarIOS;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
require "json"
|
|
2
|
-
|
|
3
|
-
json = File.read(File.join(__dir__, "package.json"))
|
|
4
|
-
package = JSON.parse(json).deep_symbolize_keys
|
|
5
|
-
|
|
6
|
-
Pod::Spec.new do |s|
|
|
7
|
-
s.name = package[:name]
|
|
8
|
-
s.version = package[:version]
|
|
9
|
-
s.license = { type: "Apache-2.0" }
|
|
10
|
-
s.homepage = "https://github.com/radarlabs/react-native-radar"
|
|
11
|
-
s.authors = package[:author] || "radarlabs"
|
|
12
|
-
s.summary = package[:description]
|
|
13
|
-
s.source = { git: package[:repository][:url] }
|
|
14
|
-
s.source_files = "ios/*.{h,m}"
|
|
15
|
-
s.platform = :ios, "10.0"
|
|
16
|
-
|
|
17
|
-
s.dependency "React"
|
|
18
|
-
s.dependency "RadarSDK", "~> 3.21.8"
|
|
19
|
-
end
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|