Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Radar.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Pod::Spec.new do |s|
s.source_files = "ios/**/*.{h,m,mm,cpp}"
s.private_header_files = "ios/**/*.h"

s.dependency "RadarSDK", "~> 3.22.0"
s.dependency "RadarSDK", "3.24.0-beta.3"

install_modules_dependencies(s)
end
2 changes: 1 addition & 1 deletion android/src/newarch/java/com/radar/RadarModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class RadarModule(reactContext: ReactApplicationContext) :
override fun initialize(publishableKey: String, fraud: Boolean): Unit {
val editor = reactApplicationContext.getSharedPreferences("RadarSDK", Context.MODE_PRIVATE).edit()
editor.putString("x_platform_sdk_type", "ReactNative")
editor.putString("x_platform_sdk_version", "3.22.0")
editor.putString("x_platform_sdk_version", "3.24.0-beta.3")
editor.apply()

if (fraud) {
Expand Down
2 changes: 1 addition & 1 deletion android/src/oldarch/java/com/radar/RadarModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public void initialize(String publishableKey, boolean fraud) {
this.fraud = fraud;
SharedPreferences.Editor editor = getReactApplicationContext().getSharedPreferences("RadarSDK", Context.MODE_PRIVATE).edit();
editor.putString("x_platform_sdk_type", "ReactNative");
editor.putString("x_platform_sdk_version", "3.22.0");
editor.putString("x_platform_sdk_version", "3.24.0-beta.3");
editor.apply();
if (fraud) {
Radar.initialize(getReactApplicationContext(), publishableKey, receiver, Radar.RadarLocationServicesProvider.GOOGLE, fraud);
Expand Down
2 changes: 2 additions & 0 deletions example/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
"androidFraud": false,
"androidBackgroundPermission": true,
"addRadarSDKMotion": true,
"addRadarSDKIndoors": true,
"iosNSBluetoothWhenInUseUsageDescription": "This example app uses Bluetooth to detect nearby beacons for precise indoor positioning during testing. Bluetooth data is used only for positioning functionality.",
"androidActivityRecognition": true,
"androidForegroundService": true
}
Expand Down
2 changes: 1 addition & 1 deletion example/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ios/RNRadar.mm
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ - (void)didUpdateToken:(RadarVerifiedLocationToken *)token {

RCT_EXPORT_METHOD(initialize:(NSString *)publishableKey fraud:(BOOL)fraud) {
[[NSUserDefaults standardUserDefaults] setObject:@"ReactNative" forKey:@"radar-xPlatformSDKType"];
[[NSUserDefaults standardUserDefaults] setObject:@"3.22.0" forKey:@"radar-xPlatformSDKVersion"];
[[NSUserDefaults standardUserDefaults] setObject:@"3.24.0-beta.3" forKey:@"radar-xPlatformSDKVersion"];
[Radar initializeWithPublishableKey:publishableKey];
}

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "React Native module for Radar, the leading geofencing and location tracking platform",
"homepage": "https://radar.com",
"license": "Apache-2.0",
"version": "3.22.0",
"version": "3.24.0-beta.3",
"main": "dist/index.js",
"files": [
"dist",
Expand Down Expand Up @@ -123,4 +123,4 @@
}
}
}
}
}
2 changes: 2 additions & 0 deletions plugin/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ export interface RadarPluginProps {
androidActivityRecognition?: boolean;
addRadarSDKMotion?: boolean;
iosNSMotionUsageDescription?: string;
addRadarSDKIndoors?: boolean;
iosNSBluetoothWhenInUseUsageDescription?: string;
}
44 changes: 40 additions & 4 deletions plugin/src/withRadarIOS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const fs = require('fs/promises');
const path = require('path');

export const withRadarIOS = (config: any, args: RadarPluginProps) => {
config = withInfoPlist(config, (config: { modResults: { NSLocationWhenInUseUsageDescription: string; NSLocationAlwaysAndWhenInUseUsageDescription: string; UIBackgroundModes: string[]; NSAppTransportSecurity: { NSAllowsArbitraryLoads: boolean; NSPinnedDomains: { "api-verified.radar.io": { NSIncludesSubdomains: boolean; NSPinnedLeafIdentities: { "SPKI-SHA256-BASE64": string; }[]; }; }; }; NSMotionUsageDescription: string; }; }) => {
config = withInfoPlist(config, (config: { modResults: { NSLocationWhenInUseUsageDescription: string; NSLocationAlwaysAndWhenInUseUsageDescription: string; UIBackgroundModes: string[]; NSAppTransportSecurity: { NSAllowsArbitraryLoads: boolean; NSPinnedDomains: { "api-verified.radar.io": { NSIncludesSubdomains: boolean; NSPinnedLeafIdentities: { "SPKI-SHA256-BASE64": string; }[]; }; }; }; NSMotionUsageDescription: string; NSBluetoothWhenInUseUsageDescription: string; }; }) => {
config.modResults.NSLocationWhenInUseUsageDescription =
args.iosNSLocationWhenInUseUsageDescription ??
"This app uses the location service to provide location-based services.";
Expand Down Expand Up @@ -40,6 +40,11 @@ export const withRadarIOS = (config: any, args: RadarPluginProps) => {
args.iosNSMotionUsageDescription ??
"This app uses the motion service to provide motion-based services.";
}
if (args.addRadarSDKIndoors) {
config.modResults.NSBluetoothWhenInUseUsageDescription =
args.iosNSBluetoothWhenInUseUsageDescription ??
"This app uses Bluetooth to detect nearby beacons for precise indoor positioning. Bluetooth data is used only for positioning functionality and is not shared with third parties.";
}

return config;
});
Expand All @@ -52,7 +57,7 @@ export const withRadarIOS = (config: any, args: RadarPluginProps) => {
const contents = await fs.readFile(filePath, 'utf-8');

// Check if the pod declaration already exists
if (contents.indexOf("pod 'RadarSDKMotion', '3.20.1'") === -1) {
if (contents.indexOf("pod 'RadarSDKMotion', '3.24.0-beta.3'") === -1) {
// Find the target block
const targetRegex = /target '(\w+)' do/g;
const match = targetRegex.exec(contents);
Expand All @@ -63,7 +68,38 @@ export const withRadarIOS = (config: any, args: RadarPluginProps) => {
// Insert the pod declaration within the target block
const targetBlock = contents.substring(targetStartIndex, targetEndIndex);
// 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.
const updatedTargetBlock = targetBlock.replace(/(target '(\w+)' do)/, `$1\n pod 'RadarSDKMotion', '3.20.1'`);
const updatedTargetBlock = targetBlock.replace(/(target '(\w+)' do)/, `$1\n pod 'RadarSDKMotion', '3.24.0-beta.3'`);
const newContents = contents.replace(targetBlock, updatedTargetBlock);

// Write the updated contents back to the Podfile
await fs.writeFile(filePath, newContents);
}
}

return config;
},
]);
}

if (args.addRadarSDKIndoors) {
config = withDangerousMod(config, [
'ios',
async (config: { modRequest: { platformProjectRoot: any; }; }) => {
const filePath = path.join(config.modRequest.platformProjectRoot, 'Podfile');
const contents = await fs.readFile(filePath, 'utf-8');

// Check if the pod declaration already exists
if (contents.indexOf("pod 'RadarSDKIndoors', '3.24.0-beta.3'") === -1) {
// Find the target block
const targetRegex = /target '(\w+)' do/g;
const match = targetRegex.exec(contents);
if (match) {
const targetStartIndex = match.index;
const targetEndIndex = contents.indexOf('end', targetStartIndex) + 3;

// Insert the pod declaration within the target block
const targetBlock = contents.substring(targetStartIndex, targetEndIndex);
const updatedTargetBlock = targetBlock.replace(/(target '(\w+)' do)/, `$1\n pod 'RadarSDKIndoors', '3.24.0-beta.3'`);
const newContents = contents.replace(targetBlock, updatedTargetBlock);

// Write the updated contents back to the Podfile
Expand All @@ -77,4 +113,4 @@ export const withRadarIOS = (config: any, args: RadarPluginProps) => {
}

return config;
};
};
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// This file contains the version of the react-native-radar package
// It should be updated to match the version in package.json
export const VERSION = '3.22.0';
export const VERSION = '3.24.0-beta.3';