react-native-radar 4.31.0-beta.1 → 4.31.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.
@@ -143,7 +143,7 @@ class RadarModule(reactContext: ReactApplicationContext) :
143
143
  override fun initialize(publishableKey: String, fraud: Boolean, options: ReadableMap?): Unit {
144
144
  val editor = reactApplicationContext.getSharedPreferences("RadarSDK", Context.MODE_PRIVATE).edit()
145
145
  editor.putString("x_platform_sdk_type", "ReactNative")
146
- editor.putString("x_platform_sdk_version", "4.31.0-beta.1")
146
+ editor.putString("x_platform_sdk_version", "4.31.0-beta.2")
147
147
  editor.apply()
148
148
 
149
149
  Radar.initialize(reactApplicationContext, publishableKey, radarReceiver, Radar.RadarLocationServicesProvider.GOOGLE, fraud, null, radarInAppMessageReceiver, currentActivity)
@@ -155,7 +155,7 @@ class RadarModule(reactContext: ReactApplicationContext) :
155
155
  override fun initializeWithAuthToken(authToken: String, fraud: Boolean, options: ReadableMap?): Unit {
156
156
  val editor = reactApplicationContext.getSharedPreferences("RadarSDK", Context.MODE_PRIVATE).edit()
157
157
  editor.putString("x_platform_sdk_type", "ReactNative")
158
- editor.putString("x_platform_sdk_version", "4.31.0-beta.1")
158
+ editor.putString("x_platform_sdk_version", "4.31.0-beta.2")
159
159
  editor.apply()
160
160
 
161
161
  val initOptions = io.radar.sdk.RadarInitializeOptions.builder()
@@ -102,7 +102,7 @@ public class RadarModule extends ReactContextBaseJavaModule implements Permissio
102
102
  this.fraud = fraud;
103
103
  SharedPreferences.Editor editor = getReactApplicationContext().getSharedPreferences("RadarSDK", Context.MODE_PRIVATE).edit();
104
104
  editor.putString("x_platform_sdk_type", "ReactNative");
105
- editor.putString("x_platform_sdk_version", "4.31.0-beta.1");
105
+ editor.putString("x_platform_sdk_version", "4.31.0-beta.2");
106
106
  editor.apply();
107
107
  Radar.initialize(getReactApplicationContext(), publishableKey, receiver, Radar.RadarLocationServicesProvider.GOOGLE, fraud, null, inAppMessageReceiver, getCurrentActivity());
108
108
  if (fraud) {
@@ -115,7 +115,7 @@ public class RadarModule extends ReactContextBaseJavaModule implements Permissio
115
115
  this.fraud = fraud;
116
116
  SharedPreferences.Editor editor = getReactApplicationContext().getSharedPreferences("RadarSDK", Context.MODE_PRIVATE).edit();
117
117
  editor.putString("x_platform_sdk_type", "ReactNative");
118
- editor.putString("x_platform_sdk_version", "4.31.0-beta.1");
118
+ editor.putString("x_platform_sdk_version", "4.31.0-beta.2");
119
119
  editor.apply();
120
120
 
121
121
  io.radar.sdk.RadarInitializeOptions.Builder builder = io.radar.sdk.RadarInitializeOptions.builder()
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "4.31.0-beta.1";
1
+ export declare const VERSION = "4.31.0-beta.2";
package/dist/version.js CHANGED
@@ -3,4 +3,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
4
  // This file contains the version of the react-native-radar package
5
5
  // It should be updated to match the version in package.json
6
- exports.VERSION = '4.31.0-beta.1';
6
+ exports.VERSION = '4.31.0-beta.2';
package/ios/RNRadar.mm CHANGED
@@ -217,7 +217,7 @@ RCT_EXPORT_MODULE()
217
217
  RCT_EXPORT_METHOD(initialize:(NSString *)publishableKey fraud:(BOOL)fraud options:(NSDictionary *)options) {
218
218
  _publishableKey = publishableKey;
219
219
  [[NSUserDefaults standardUserDefaults] setObject:@"ReactNative" forKey:@"radar-xPlatformSDKType"];
220
- [[NSUserDefaults standardUserDefaults] setObject:@"4.31.0-beta.1" forKey:@"radar-xPlatformSDKVersion"];
220
+ [[NSUserDefaults standardUserDefaults] setObject:@"4.31.0-beta.2" forKey:@"radar-xPlatformSDKVersion"];
221
221
 
222
222
  RadarInitializeOptions *radarOptions = [[RadarInitializeOptions alloc] init];
223
223
  if (options != nil) {
@@ -240,7 +240,7 @@ RCT_EXPORT_METHOD(initialize:(NSString *)publishableKey fraud:(BOOL)fraud option
240
240
  RCT_EXPORT_METHOD(initializeWithAuthToken:(NSString *)authToken fraud:(BOOL)fraud options:(NSDictionary *)options) {
241
241
  _publishableKey = nil;
242
242
  [[NSUserDefaults standardUserDefaults] setObject:@"ReactNative" forKey:@"radar-xPlatformSDKType"];
243
- [[NSUserDefaults standardUserDefaults] setObject:@"4.31.0-beta.1" forKey:@"radar-xPlatformSDKVersion"];
243
+ [[NSUserDefaults standardUserDefaults] setObject:@"4.31.0-beta.2" forKey:@"radar-xPlatformSDKVersion"];
244
244
  RadarInitializeOptions *radarOptions = [[RadarInitializeOptions alloc] init];
245
245
  if (options != nil) {
246
246
  id silentPushValue = options[@"silentPush"];
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": "4.31.0-beta.1",
6
+ "version": "4.31.0-beta.2",
7
7
  "main": "dist/index.js",
8
8
  "files": [
9
9
  "dist",
@@ -6,32 +6,32 @@ const fs = require('fs/promises');
6
6
  const path = require('path');
7
7
  const pkg = require("../../package.json");
8
8
  const NATIVE_SETUP_SENTINEL = "@generated react-native-radar nativeSetup";
9
- function buildObjcSnippet(args) {
9
+ function buildObjcSnippet(args, indent = " ") {
10
10
  const lines = [
11
- ` // ${NATIVE_SETUP_SENTINEL}`,
12
- ` RadarInitializeOptions *radarInitializeOptions = [[RadarInitializeOptions alloc] init];`,
11
+ `${indent}// ${NATIVE_SETUP_SENTINEL}`,
12
+ `${indent}RadarInitializeOptions *radarInitializeOptions = [[RadarInitializeOptions alloc] init];`,
13
13
  ];
14
14
  if (args.iosAutoHandleNotificationDeepLinks) {
15
- lines.push(` radarInitializeOptions.autoHandleNotificationDeepLinks = YES;`);
15
+ lines.push(`${indent}radarInitializeOptions.autoHandleNotificationDeepLinks = YES;`);
16
16
  }
17
17
  if (args.iosAutoLogNotificationConversions) {
18
- lines.push(` radarInitializeOptions.autoLogNotificationConversions = YES;`);
18
+ lines.push(`${indent}radarInitializeOptions.autoLogNotificationConversions = YES;`);
19
19
  }
20
- lines.push(` [Radar nativeSetup:radarInitializeOptions];`);
20
+ lines.push(`${indent}[Radar nativeSetup:radarInitializeOptions];`);
21
21
  return lines.join("\n");
22
22
  }
23
- function buildSwiftSnippet(args) {
23
+ function buildSwiftSnippet(args, indent = " ") {
24
24
  const lines = [
25
- ` // ${NATIVE_SETUP_SENTINEL}`,
26
- ` let radarInitializeOptions = RadarInitializeOptions()`,
25
+ `${indent}// ${NATIVE_SETUP_SENTINEL}`,
26
+ `${indent}let radarInitializeOptions = RadarInitializeOptions()`,
27
27
  ];
28
28
  if (args.iosAutoHandleNotificationDeepLinks) {
29
- lines.push(` radarInitializeOptions.autoHandleNotificationDeepLinks = true`);
29
+ lines.push(`${indent}radarInitializeOptions.autoHandleNotificationDeepLinks = true`);
30
30
  }
31
31
  if (args.iosAutoLogNotificationConversions) {
32
- lines.push(` radarInitializeOptions.autoLogNotificationConversions = true`);
32
+ lines.push(`${indent}radarInitializeOptions.autoLogNotificationConversions = true`);
33
33
  }
34
- lines.push(` Radar.nativeSetup(radarInitializeOptions)`);
34
+ lines.push(`${indent}Radar.nativeSetup(radarInitializeOptions)`);
35
35
  return lines.join("\n");
36
36
  }
37
37
  function withRadarAppDelegate(config, args) {
@@ -49,23 +49,25 @@ function withRadarAppDelegate(config, args) {
49
49
  if (!contents.includes("RadarSDK/RadarSDK.h")) {
50
50
  contents = contents.replace(/(#import\s+"AppDelegate\.h")/, `$1\n#import <RadarSDK/RadarSDK.h>`);
51
51
  }
52
- const anchor = "[super application:application didFinishLaunchingWithOptions:launchOptions];";
53
- if (!contents.includes(anchor)) {
52
+ const anchorRegex = /^([ \t]*)(return\s+|BOOL\s+\w+\s*=\s*)?\[super\s+application:application\s+didFinishLaunchingWithOptions:launchOptions\]\s*;/m;
53
+ const match = contents.match(anchorRegex);
54
+ if (!match) {
54
55
  WarningAggregator.addWarningIOS("react-native-radar", "Could not find didFinishLaunchingWithOptions super call in AppDelegate; skipping nativeSetup injection.");
55
56
  return config;
56
57
  }
57
- contents = contents.replace(anchor, `${anchor}\n${buildObjcSnippet(args)}`);
58
+ contents = contents.replace(anchorRegex, `${buildObjcSnippet(args, match[1])}\n${match[0]}`);
58
59
  }
59
60
  else if (language === "swift") {
60
61
  if (!/^import RadarSDK\b/m.test(contents)) {
61
62
  contents = contents.replace(/(import Expo\b.*)/, `$1\nimport RadarSDK`);
62
63
  }
63
- const anchor = "super.application(application, didFinishLaunchingWithOptions: launchOptions)";
64
- if (!contents.includes(anchor)) {
64
+ const anchorRegex = /^([ \t]*)(return\s+)?super\.application\(application,\s*didFinishLaunchingWithOptions:\s*launchOptions\)/m;
65
+ const match = contents.match(anchorRegex);
66
+ if (!match) {
65
67
  WarningAggregator.addWarningIOS("react-native-radar", "Could not find didFinishLaunchingWithOptions super call in AppDelegate.swift; skipping nativeSetup injection.");
66
68
  return config;
67
69
  }
68
- contents = contents.replace(anchor, `${anchor}\n${buildSwiftSnippet(args)}`);
70
+ contents = contents.replace(anchorRegex, `${buildSwiftSnippet(args, match[1])}\n${match[0]}`);
69
71
  }
70
72
  else {
71
73
  WarningAggregator.addWarningIOS("react-native-radar", `Unsupported AppDelegate language "${language}"; skipping Radar nativeSetup injection.`);
package/src/version.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  // This file contains the version of the react-native-radar package
2
2
  // It should be updated to match the version in package.json
3
- export const VERSION = '4.31.0-beta.1';
3
+ export const VERSION = '4.31.0-beta.2';