react-native-radar 4.1.0 → 4.2.0
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/src/newarch/java/com/radar/RadarModule.kt +2 -2
- package/android/src/oldarch/java/com/radar/RadarModule.java +2 -2
- package/dist/@types/types.d.ts +9 -4
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/ios/RNRadar.mm +2 -2
- package/package.json +2 -2
- package/src/@types/maplibre-react-native.d.ts +1 -14
- package/src/@types/types.ts +9 -5
- package/src/version.ts +1 -1
|
@@ -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.
|
|
146
|
+
editor.putString("x_platform_sdk_version", "4.2.0")
|
|
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.
|
|
158
|
+
editor.putString("x_platform_sdk_version", "4.2.0")
|
|
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.
|
|
105
|
+
editor.putString("x_platform_sdk_version", "4.2.0");
|
|
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.
|
|
118
|
+
editor.putString("x_platform_sdk_version", "4.2.0");
|
|
119
119
|
editor.apply();
|
|
120
120
|
|
|
121
121
|
io.radar.sdk.RadarInitializeOptions.Builder builder = io.radar.sdk.RadarInitializeOptions.builder()
|
package/dist/@types/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { type NativeSyntheticEvent } from "react-native";
|
|
2
3
|
import type { MapRef } from "@maplibre/maplibre-react-native";
|
|
3
4
|
export type RadarMetadata = Record<string, string | number | boolean>;
|
|
4
5
|
export interface RadarTrackOnceOptions {
|
|
@@ -584,14 +585,18 @@ export interface RadarMapOptions {
|
|
|
584
585
|
showUserLocation?: boolean;
|
|
585
586
|
mapRef?: React.Ref<MapRef>;
|
|
586
587
|
onRegionDidChange?: (event: RadarMapRegionChangeEvent) => void;
|
|
587
|
-
onDidFinishLoadingMap?: () => void;
|
|
588
|
-
onWillStartLoadingMap?: () => void;
|
|
589
|
-
onDidFailLoadingMap?: () => void;
|
|
588
|
+
onDidFinishLoadingMap?: (event: NativeSyntheticEvent<null>) => void;
|
|
589
|
+
onWillStartLoadingMap?: (event: NativeSyntheticEvent<null>) => void;
|
|
590
|
+
onDidFailLoadingMap?: (event: NativeSyntheticEvent<null>) => void;
|
|
590
591
|
}
|
|
591
592
|
export interface RadarMapRegionChangeEvent {
|
|
592
593
|
center: [number, number];
|
|
593
594
|
zoom: number;
|
|
594
|
-
|
|
595
|
+
/**
|
|
596
|
+
* Geographic bounds in `[west, south, east, north]` order (south-west corner
|
|
597
|
+
* then north-east corner, per GeoJSON RFC 7946).
|
|
598
|
+
*/
|
|
599
|
+
bounds?: [west: number, south: number, east: number, north: number];
|
|
595
600
|
bearing?: number;
|
|
596
601
|
pitch?: number;
|
|
597
602
|
animated: boolean;
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "4.
|
|
1
|
+
export declare const VERSION = "4.2.0";
|
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.
|
|
6
|
+
exports.VERSION = '4.2.0';
|
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.
|
|
220
|
+
[[NSUserDefaults standardUserDefaults] setObject:@"4.2.0" 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.
|
|
243
|
+
[[NSUserDefaults standardUserDefaults] setObject:@"4.2.0" 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.
|
|
6
|
+
"version": "4.2.0",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"files": [
|
|
9
9
|
"dist",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
]
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
|
-
"@maplibre/maplibre-react-native": "
|
|
59
|
+
"@maplibre/maplibre-react-native": "^11.0.0",
|
|
60
60
|
"expo": ">=43.0.5",
|
|
61
61
|
"react": ">= 19.1.0",
|
|
62
62
|
"react-native": ">= 0.80.0",
|
|
@@ -1,16 +1,3 @@
|
|
|
1
1
|
declare module "@maplibre/maplibre-react-native" {
|
|
2
|
-
export interface MapRef {
|
|
3
|
-
getCenter(): Promise<{ lng: number; lat: number }>;
|
|
4
|
-
getZoom(): Promise<number>;
|
|
5
|
-
getBearing(): Promise<number>;
|
|
6
|
-
getPitch(): Promise<number>;
|
|
7
|
-
getBounds(): Promise<{ ne: [number, number]; sw: [number, number] }>;
|
|
8
|
-
project(coordinate: [number, number]): Promise<{ x: number; y: number }>;
|
|
9
|
-
unproject(point: { x: number; y: number }): Promise<[number, number]>;
|
|
10
|
-
queryRenderedFeatures(
|
|
11
|
-
point: [number, number] | [[number, number], [number, number]],
|
|
12
|
-
filter?: string[],
|
|
13
|
-
layerIDs?: string[],
|
|
14
|
-
): Promise<GeoJSON.FeatureCollection>;
|
|
15
|
-
}
|
|
2
|
+
export interface MapRef {}
|
|
16
3
|
}
|
package/src/@types/types.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Platform } from "react-native";
|
|
2
|
+
import { Platform, type NativeSyntheticEvent } from "react-native";
|
|
3
3
|
import type { MapRef } from "@maplibre/maplibre-react-native";
|
|
4
4
|
const platform = Platform.OS;
|
|
5
5
|
|
|
@@ -908,15 +908,19 @@ export interface RadarMapOptions {
|
|
|
908
908
|
showUserLocation?: boolean;
|
|
909
909
|
mapRef?: React.Ref<MapRef>;
|
|
910
910
|
onRegionDidChange?: (event: RadarMapRegionChangeEvent) => void;
|
|
911
|
-
onDidFinishLoadingMap?: () => void;
|
|
912
|
-
onWillStartLoadingMap?: () => void;
|
|
913
|
-
onDidFailLoadingMap?: () => void;
|
|
911
|
+
onDidFinishLoadingMap?: (event: NativeSyntheticEvent<null>) => void;
|
|
912
|
+
onWillStartLoadingMap?: (event: NativeSyntheticEvent<null>) => void;
|
|
913
|
+
onDidFailLoadingMap?: (event: NativeSyntheticEvent<null>) => void;
|
|
914
914
|
}
|
|
915
915
|
|
|
916
916
|
export interface RadarMapRegionChangeEvent {
|
|
917
917
|
center: [number, number];
|
|
918
918
|
zoom: number;
|
|
919
|
-
|
|
919
|
+
/**
|
|
920
|
+
* Geographic bounds in `[west, south, east, north]` order (south-west corner
|
|
921
|
+
* then north-east corner, per GeoJSON RFC 7946).
|
|
922
|
+
*/
|
|
923
|
+
bounds?: [west: number, south: number, east: number, north: number];
|
|
920
924
|
bearing?: number;
|
|
921
925
|
pitch?: number;
|
|
922
926
|
animated: boolean;
|
package/src/version.ts
CHANGED