react-native-radar 3.19.0-beta.1 → 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.
@@ -45,7 +45,5 @@ repositories {
45
45
 
46
46
  dependencies {
47
47
  api 'com.facebook.react:react-native:+'
48
- api 'org.nanohttpd:nanohttpd:2.3.1'
49
48
  api 'io.radar:sdk:3.18.8-beta.1'
50
49
  }
51
-
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.19.0-beta.1",
6
+ "version": "3.19.0-beta.2",
7
7
  "main": "dist/index.js",
8
8
  "files": [
9
9
  "/android",
@@ -52,7 +52,7 @@ const withRadarAndroid = (config, args) => {
52
52
  ]);
53
53
  return (0, config_plugins_1.withAppBuildGradle)(config, (config) => {
54
54
  if (config.modResults.language === "groovy") {
55
- config.modResults.contents = modifyAppBuildGradle(config.modResults.contents, args.androidFraud ?? false);
55
+ config.modResults.contents = modifyAppBuildGradle(config.modResults.contents, args.androidFraud ?? false, args.addRadarSDKVerify ?? false);
56
56
  }
57
57
  else {
58
58
  throw new Error("Cannot configure Sentry in the app gradle because the build.gradle is not groovy");
@@ -86,15 +86,19 @@ async function setCustomConfigAsync(config, androidManifest, args) {
86
86
  }
87
87
  return androidManifest;
88
88
  }
89
- function modifyAppBuildGradle(buildGradle, androidFraud) {
89
+ function modifyAppBuildGradle(buildGradle, androidFraud, addRadarSDKVerify) {
90
90
  let hasLocationService = false;
91
91
  let hasPlayIntegrity = false;
92
+ let hasNanoHTTPD = false;
92
93
  if (buildGradle.includes('com.google.android.gms:play-services-location:21.0.1"')) {
93
94
  hasLocationService = true;
94
95
  }
95
96
  if (buildGradle.includes('com.google.android.play:integrity:1.2.0"')) {
96
97
  hasPlayIntegrity = true;
97
98
  }
99
+ if (buildGradle.includes('org.nanohttpd:nanohttpd:2.3.1"')) {
100
+ hasNanoHTTPD = true;
101
+ }
98
102
  const pattern = /^dependencies {/m;
99
103
  if (!buildGradle.match(pattern)) {
100
104
  config_plugins_1.WarningAggregator.addWarningAndroid("react-native-radar", "Could not find react.gradle script in android/app/build.gradle.");
@@ -107,5 +111,9 @@ function modifyAppBuildGradle(buildGradle, androidFraud) {
107
111
  replacementString +=
108
112
  "\n\n" + ' implementation "com.google.android.play:integrity:1.2.0"';
109
113
  }
114
+ if (addRadarSDKVerify && !hasNanoHTTPD) {
115
+ replacementString +=
116
+ "\n\n" + ' implementation "org.nanohttpd:nanohttpd:2.3.1"';
117
+ }
110
118
  return buildGradle.replace(pattern, (match) => match + replacementString);
111
119
  }
@@ -77,7 +77,7 @@ const withRadarIOS = (config, args) => {
77
77
  const filePath = path_1.default.join(config.modRequest.platformProjectRoot, 'Podfile');
78
78
  const contents = await promises_1.default.readFile(filePath, 'utf-8');
79
79
  // Check if the pod declaration already exists
80
- if (contents.indexOf("pod 'Telegraph', '0.30.0'") === -1) {
80
+ if (contents.indexOf("pod 'RadarSDK/Verify', '3.19.2-beta.9'") === -1) {
81
81
  // Find the target block
82
82
  const targetRegex = /target '(\w+)' do/g;
83
83
  const match = targetRegex.exec(contents);
@@ -86,7 +86,7 @@ const withRadarIOS = (config, args) => {
86
86
  const targetEndIndex = contents.indexOf('end', targetStartIndex) + 3;
87
87
  // Insert the pod declaration within the target block
88
88
  const targetBlock = contents.substring(targetStartIndex, targetEndIndex);
89
- const updatedTargetBlock = targetBlock.replace(/(target '(\w+)' do)/, `$1\n pod 'Telegraph', '0.30.0', :modular_headers => true\n pod 'CocoaAsyncSocket', :modular_headers => true\n pod 'HTTPParserC', :modular_headers => true`);
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
90
  const newContents = contents.replace(targetBlock, updatedTargetBlock);
91
91
  // Write the updated contents back to the Podfile
92
92
  await promises_1.default.writeFile(filePath, newContents);
@@ -15,5 +15,5 @@ Pod::Spec.new do |s|
15
15
  s.platform = :ios, "12.0"
16
16
 
17
17
  s.dependency "React"
18
- s.dependency "RadarSDK", "~> 3.19.2-beta.6"
18
+ s.dependency "RadarSDK", "~> 3.19.2-beta.9"
19
19
  end