react-native-radar 3.31.0-beta.1 → 4.0.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 +1 -1
- package/android/src/oldarch/java/com/radar/RadarModule.java +1 -1
- package/dist/ui/autocomplete.js +9 -3
- package/dist/ui/autocomplete.jsx +6 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/ios/RNRadar.mm +45 -17
- package/package.json +5 -2
- package/src/ui/autocomplete.jsx +6 -1
- package/src/version.ts +1 -1
|
@@ -143,7 +143,7 @@ class RadarModule(reactContext: ReactApplicationContext) :
|
|
|
143
143
|
override fun initialize(publishableKey: String, fraud: Boolean): 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", "
|
|
146
|
+
editor.putString("x_platform_sdk_version", "4.0.0")
|
|
147
147
|
editor.apply()
|
|
148
148
|
|
|
149
149
|
Radar.initialize(reactApplicationContext, publishableKey, radarReceiver, Radar.RadarLocationServicesProvider.GOOGLE, fraud, null, radarInAppMessageReceiver, currentActivity)
|
|
@@ -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", "
|
|
105
|
+
editor.putString("x_platform_sdk_version", "4.0.0");
|
|
106
106
|
editor.apply();
|
|
107
107
|
Radar.initialize(getReactApplicationContext(), publishableKey, receiver, Radar.RadarLocationServicesProvider.GOOGLE, fraud, null, inAppMessageReceiver, getCurrentActivity());
|
|
108
108
|
if (fraud) {
|
package/dist/ui/autocomplete.js
CHANGED
|
@@ -48,7 +48,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
48
48
|
// Autocomplete.js
|
|
49
49
|
const react_1 = __importStar(require("react"));
|
|
50
50
|
const react_native_1 = require("react-native");
|
|
51
|
-
|
|
51
|
+
let SafeAreaView;
|
|
52
|
+
try {
|
|
53
|
+
SafeAreaView = require('react-native-safe-area-context').SafeAreaView;
|
|
54
|
+
}
|
|
55
|
+
catch (e) {
|
|
56
|
+
SafeAreaView = require('react-native').SafeAreaView;
|
|
57
|
+
}
|
|
52
58
|
const index_native_1 = __importDefault(require("../index.native"));
|
|
53
59
|
const images_1 = require("./images");
|
|
54
60
|
const styles_1 = __importDefault(require("./styles"));
|
|
@@ -184,7 +190,7 @@ const autocompleteUI = ({ options = {} }) => {
|
|
|
184
190
|
</react_native_1.Animated.View>
|
|
185
191
|
<react_native_1.Modal animationType="slide" transparent={false} visible={isOpen} onRequestClose={() => setIsOpen(false)}>
|
|
186
192
|
<react_native_1.Animated.View style={{ flex: 1, opacity: modalOpacity }}>
|
|
187
|
-
<
|
|
193
|
+
<SafeAreaView>
|
|
188
194
|
<react_native_1.KeyboardAvoidingView behavior={react_native_1.Platform.OS === "ios" ? "padding" : "height"} keyboardVerticalOffset={50} style={styles.container}>
|
|
189
195
|
<react_native_1.View style={styles.modalInputContainer}>
|
|
190
196
|
<react_native_1.TouchableOpacity onPress={() => {
|
|
@@ -209,7 +215,7 @@ const autocompleteUI = ({ options = {} }) => {
|
|
|
209
215
|
{renderFooter()}
|
|
210
216
|
</react_native_1.View>)}
|
|
211
217
|
</react_native_1.KeyboardAvoidingView>
|
|
212
|
-
</
|
|
218
|
+
</SafeAreaView>
|
|
213
219
|
</react_native_1.Animated.View>
|
|
214
220
|
</react_native_1.Modal>
|
|
215
221
|
</react_native_1.View>);
|
package/dist/ui/autocomplete.jsx
CHANGED
|
@@ -17,7 +17,12 @@ import {
|
|
|
17
17
|
Pressable,
|
|
18
18
|
Platform,
|
|
19
19
|
} from 'react-native';
|
|
20
|
-
|
|
20
|
+
let SafeAreaView;
|
|
21
|
+
try {
|
|
22
|
+
SafeAreaView = require('react-native-safe-area-context').SafeAreaView;
|
|
23
|
+
} catch (e) {
|
|
24
|
+
SafeAreaView = require('react-native').SafeAreaView;
|
|
25
|
+
}
|
|
21
26
|
import Radar from '../index.native';
|
|
22
27
|
import {
|
|
23
28
|
BACK_ICON,
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "
|
|
1
|
+
export declare const VERSION = "4.0.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 = '
|
|
6
|
+
exports.VERSION = '4.0.0';
|
package/ios/RNRadar.mm
CHANGED
|
@@ -9,6 +9,9 @@ static NSString *_publishableKey = nil;
|
|
|
9
9
|
CLLocationManager *locationManager;
|
|
10
10
|
RCTPromiseResolveBlock permissionsRequestResolver;
|
|
11
11
|
bool hasListeners;
|
|
12
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
13
|
+
bool jsEventEmitterReady;
|
|
14
|
+
#endif
|
|
12
15
|
}
|
|
13
16
|
|
|
14
17
|
RCT_EXPORT_MODULE()
|
|
@@ -52,12 +55,21 @@ RCT_EXPORT_MODULE()
|
|
|
52
55
|
hasListeners = NO;
|
|
53
56
|
}
|
|
54
57
|
|
|
58
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
59
|
+
- (void)setEventEmitterCallback:(EventEmitterCallbackWrapper *)eventEmitterCallbackWrapper {
|
|
60
|
+
[super setEventEmitterCallback:eventEmitterCallbackWrapper];
|
|
61
|
+
jsEventEmitterReady = YES;
|
|
62
|
+
}
|
|
63
|
+
#endif
|
|
64
|
+
|
|
55
65
|
- (void)onNewInAppMessage:(RadarInAppMessage *)inAppMessage {
|
|
56
66
|
|
|
57
67
|
NSMutableDictionary *body = [NSMutableDictionary new];
|
|
58
68
|
[body setValue:[Radar dictionaryForInAppMessage:inAppMessage] forKey:@"inAppMessage"];
|
|
59
69
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
60
|
-
|
|
70
|
+
if (jsEventEmitterReady) {
|
|
71
|
+
[self emitNewInAppMessageEmitter:body];
|
|
72
|
+
}
|
|
61
73
|
#else
|
|
62
74
|
if (hasListeners) {
|
|
63
75
|
[self sendEventWithName:@"newInAppMessageEmitter" body:body];
|
|
@@ -69,7 +81,9 @@ RCT_EXPORT_MODULE()
|
|
|
69
81
|
NSMutableDictionary *body = [NSMutableDictionary new];
|
|
70
82
|
[body setValue:[Radar dictionaryForInAppMessage:inAppMessage] forKey:@"inAppMessage"];
|
|
71
83
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
72
|
-
|
|
84
|
+
if (jsEventEmitterReady) {
|
|
85
|
+
[self emitInAppMessageDismissedEmitter:body];
|
|
86
|
+
}
|
|
73
87
|
#else
|
|
74
88
|
if (hasListeners) {
|
|
75
89
|
[self sendEventWithName:@"inAppMessageDismissedEmitter" body:body];
|
|
@@ -81,7 +95,9 @@ RCT_EXPORT_MODULE()
|
|
|
81
95
|
NSMutableDictionary *body = [NSMutableDictionary new];
|
|
82
96
|
[body setValue:[Radar dictionaryForInAppMessage:inAppMessage] forKey:@"inAppMessage"];
|
|
83
97
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
84
|
-
|
|
98
|
+
if (jsEventEmitterReady) {
|
|
99
|
+
[self emitInAppMessageClickedEmitter:body];
|
|
100
|
+
}
|
|
85
101
|
#else
|
|
86
102
|
if (hasListeners) {
|
|
87
103
|
[self sendEventWithName:@"inAppMessageClickedEmitter" body:body];
|
|
@@ -105,7 +121,9 @@ RCT_EXPORT_MODULE()
|
|
|
105
121
|
[body setValue:[user dictionaryValue] forKey:@"user"];
|
|
106
122
|
}
|
|
107
123
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
108
|
-
|
|
124
|
+
if (jsEventEmitterReady) {
|
|
125
|
+
[self emitEventsEmitter:body];
|
|
126
|
+
}
|
|
109
127
|
#else
|
|
110
128
|
if (hasListeners) {
|
|
111
129
|
[self sendEventWithName:@"eventsEmitter" body:body];
|
|
@@ -115,10 +133,12 @@ RCT_EXPORT_MODULE()
|
|
|
115
133
|
|
|
116
134
|
- (void)didUpdateLocation:(CLLocation *)location user:(RadarUser *)user {
|
|
117
135
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
136
|
+
if (jsEventEmitterReady) {
|
|
137
|
+
[self emitLocationEmitter:@{
|
|
138
|
+
@"location": [Radar dictionaryForLocation:location],
|
|
139
|
+
@"user": [user dictionaryValue]
|
|
140
|
+
}];
|
|
141
|
+
}
|
|
122
142
|
#else
|
|
123
143
|
if (hasListeners) {
|
|
124
144
|
[self sendEventWithName:@"locationEmitter" body:@{
|
|
@@ -131,11 +151,13 @@ RCT_EXPORT_MODULE()
|
|
|
131
151
|
|
|
132
152
|
- (void)didUpdateClientLocation:(CLLocation *)location stopped:(BOOL)stopped source:(RadarLocationSource)source {
|
|
133
153
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
154
|
+
if (jsEventEmitterReady) {
|
|
155
|
+
[self emitClientLocationEmitter:@{
|
|
156
|
+
@"location": [Radar dictionaryForLocation:location],
|
|
157
|
+
@"stopped": @(stopped),
|
|
158
|
+
@"source": [Radar stringForLocationSource:source]
|
|
159
|
+
}];
|
|
160
|
+
}
|
|
139
161
|
#else
|
|
140
162
|
if (hasListeners) {
|
|
141
163
|
[self sendEventWithName:@"clientLocationEmitter" body:@{
|
|
@@ -152,7 +174,9 @@ RCT_EXPORT_MODULE()
|
|
|
152
174
|
@"status": [Radar stringForStatus:status]
|
|
153
175
|
};
|
|
154
176
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
155
|
-
|
|
177
|
+
if (jsEventEmitterReady) {
|
|
178
|
+
[self emitErrorEmitter:body];
|
|
179
|
+
}
|
|
156
180
|
#else
|
|
157
181
|
if (hasListeners) {
|
|
158
182
|
[self sendEventWithName:@"errorEmitter" body:body];
|
|
@@ -165,7 +189,9 @@ RCT_EXPORT_MODULE()
|
|
|
165
189
|
@"message": message
|
|
166
190
|
};
|
|
167
191
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
168
|
-
|
|
192
|
+
if (jsEventEmitterReady) {
|
|
193
|
+
[self emitLogEmitter:body];
|
|
194
|
+
}
|
|
169
195
|
#else
|
|
170
196
|
if (hasListeners) {
|
|
171
197
|
[self sendEventWithName:@"logEmitter" body:body];
|
|
@@ -178,7 +204,9 @@ RCT_EXPORT_MODULE()
|
|
|
178
204
|
@"token": [token dictionaryValue]
|
|
179
205
|
};
|
|
180
206
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
181
|
-
|
|
207
|
+
if (jsEventEmitterReady) {
|
|
208
|
+
[self emitTokenEmitter:body];
|
|
209
|
+
}
|
|
182
210
|
#else
|
|
183
211
|
if (hasListeners) {
|
|
184
212
|
[self sendEventWithName:@"tokenEmitter" body:body];
|
|
@@ -189,7 +217,7 @@ RCT_EXPORT_MODULE()
|
|
|
189
217
|
RCT_EXPORT_METHOD(initialize:(NSString *)publishableKey fraud:(BOOL)fraud) {
|
|
190
218
|
_publishableKey = publishableKey;
|
|
191
219
|
[[NSUserDefaults standardUserDefaults] setObject:@"ReactNative" forKey:@"radar-xPlatformSDKType"];
|
|
192
|
-
[[NSUserDefaults standardUserDefaults] setObject:@"
|
|
220
|
+
[[NSUserDefaults standardUserDefaults] setObject:@"4.0.0" forKey:@"radar-xPlatformSDKVersion"];
|
|
193
221
|
[Radar initializeWithPublishableKey:publishableKey];
|
|
194
222
|
}
|
|
195
223
|
|
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": "
|
|
6
|
+
"version": "4.0.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": ">=11.0.0-beta.
|
|
59
|
+
"@maplibre/maplibre-react-native": ">=11.0.0-beta.10",
|
|
60
60
|
"expo": ">=43.0.5",
|
|
61
61
|
"react": ">= 19.1.0",
|
|
62
62
|
"react-native": ">= 0.80.0",
|
|
@@ -68,6 +68,9 @@
|
|
|
68
68
|
},
|
|
69
69
|
"expo": {
|
|
70
70
|
"optional": true
|
|
71
|
+
},
|
|
72
|
+
"react-native-safe-area-context": {
|
|
73
|
+
"optional": true
|
|
71
74
|
}
|
|
72
75
|
},
|
|
73
76
|
"devDependencies": {
|
package/src/ui/autocomplete.jsx
CHANGED
|
@@ -17,7 +17,12 @@ import {
|
|
|
17
17
|
Pressable,
|
|
18
18
|
Platform,
|
|
19
19
|
} from 'react-native';
|
|
20
|
-
|
|
20
|
+
let SafeAreaView;
|
|
21
|
+
try {
|
|
22
|
+
SafeAreaView = require('react-native-safe-area-context').SafeAreaView;
|
|
23
|
+
} catch (e) {
|
|
24
|
+
SafeAreaView = require('react-native').SafeAreaView;
|
|
25
|
+
}
|
|
21
26
|
import Radar from '../index.native';
|
|
22
27
|
import {
|
|
23
28
|
BACK_ICON,
|
package/src/version.ts
CHANGED