react-native-radar 3.18.3 → 3.18.4
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/build.gradle
CHANGED
|
@@ -96,7 +96,7 @@ public class RNRadarModule extends ReactContextBaseJavaModule implements Permiss
|
|
|
96
96
|
this.fraud = fraud;
|
|
97
97
|
SharedPreferences.Editor editor = getReactApplicationContext().getSharedPreferences("RadarSDK", Context.MODE_PRIVATE).edit();
|
|
98
98
|
editor.putString("x_platform_sdk_type", "ReactNative");
|
|
99
|
-
editor.putString("x_platform_sdk_version", "3.18.
|
|
99
|
+
editor.putString("x_platform_sdk_version", "3.18.4");
|
|
100
100
|
editor.apply();
|
|
101
101
|
if (fraud) {
|
|
102
102
|
Radar.initialize(getReactApplicationContext(), publishableKey, receiver, Radar.RadarLocationServicesProvider.GOOGLE, fraud);
|
|
@@ -1115,21 +1115,37 @@ public class RNRadarModule extends ReactContextBaseJavaModule implements Permiss
|
|
|
1115
1115
|
|
|
1116
1116
|
@ReactMethod
|
|
1117
1117
|
public void validateAddress(ReadableMap addressMap, final Promise promise) {
|
|
1118
|
-
|
|
1119
|
-
|
|
1118
|
+
if (promise == null) {
|
|
1119
|
+
return;
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
RadarAddress address;
|
|
1123
|
+
try {
|
|
1124
|
+
address = RadarAddress.fromJson(RNRadarUtils.jsonForMap(addressMap));
|
|
1125
|
+
} catch (JSONException e) {
|
|
1126
|
+
promise.reject(Radar.RadarStatus.ERROR_BAD_REQUEST.toString(), Radar.RadarStatus.ERROR_BAD_REQUEST.toString());
|
|
1127
|
+
return;
|
|
1128
|
+
}
|
|
1129
|
+
Radar.validateAddress(address, new Radar.RadarValidateAddressCallback() {
|
|
1120
1130
|
@Override
|
|
1121
|
-
onComplete(@NonNull Radar.RadarStatus status, @Nullable RadarAddress address, @Nullable RadarAddressVerificationStatus verificationStatus) {
|
|
1122
|
-
if (status == Radar.RadarStatus.SUCCESS
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
map.
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1131
|
+
public void onComplete(@NonNull Radar.RadarStatus status, @Nullable RadarAddress address, @Nullable Radar.RadarAddressVerificationStatus verificationStatus) {
|
|
1132
|
+
if (status == Radar.RadarStatus.SUCCESS) {
|
|
1133
|
+
try {
|
|
1134
|
+
WritableMap map = Arguments.createMap();
|
|
1135
|
+
map.putString("status", status.toString());
|
|
1136
|
+
if (address != null) {
|
|
1137
|
+
map.putMap("address", RNRadarUtils.mapForJson(address.toJson()));
|
|
1138
|
+
}
|
|
1139
|
+
if (verificationStatus != null) {
|
|
1140
|
+
map.putString("verificationStatus", verificationStatus.toString());
|
|
1141
|
+
}
|
|
1142
|
+
promise.resolve(map);
|
|
1143
|
+
} catch (JSONException e) {
|
|
1144
|
+
Log.e(TAG, "JSONException", e);
|
|
1145
|
+
promise.reject(Radar.RadarStatus.ERROR_SERVER.toString(), Radar.RadarStatus.ERROR_SERVER.toString());
|
|
1129
1146
|
}
|
|
1130
|
-
promise.resolve(map);
|
|
1131
1147
|
} else {
|
|
1132
|
-
promise.reject(status.toString, status.toString());
|
|
1148
|
+
promise.reject(status.toString(), status.toString());
|
|
1133
1149
|
}
|
|
1134
1150
|
}
|
|
1135
1151
|
});
|
package/ios/RNRadar.m
CHANGED
|
@@ -102,7 +102,7 @@ RCT_EXPORT_MODULE();
|
|
|
102
102
|
|
|
103
103
|
RCT_EXPORT_METHOD(initialize:(NSString *)publishableKey fraud:(BOOL)fraud) {
|
|
104
104
|
[[NSUserDefaults standardUserDefaults] setObject:@"ReactNative" forKey:@"radar-xPlatformSDKType"];
|
|
105
|
-
[[NSUserDefaults standardUserDefaults] setObject:@"3.18.
|
|
105
|
+
[[NSUserDefaults standardUserDefaults] setObject:@"3.18.4" forKey:@"radar-xPlatformSDKVersion"];
|
|
106
106
|
[Radar initializeWithPublishableKey:publishableKey];
|
|
107
107
|
}
|
|
108
108
|
|
package/package.json
CHANGED