react-native-background-geolocation 4.14.1 → 4.14.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.
- package/android/libs/com/transistorsoft/tslocationmanager/maven-metadata.xml +1 -1
- package/android/libs/com/transistorsoft/tslocationmanager-v21/maven-metadata.xml +1 -1
- package/android/src/main/java/com/transistorsoft/rnbackgroundgeolocation/RNBackgroundGeolocationModule.java +5 -27
- package/package.json +1 -1
|
@@ -760,19 +760,7 @@ public class RNBackgroundGeolocationModule extends ReactContextBaseJavaModule im
|
|
|
760
760
|
try {
|
|
761
761
|
WritableArray rs = new WritableNativeArray();
|
|
762
762
|
for (TSGeofence geofence : geofences) {
|
|
763
|
-
|
|
764
|
-
data.putString("identifier", geofence.getIdentifier());
|
|
765
|
-
data.putDouble("latitude", geofence.getLatitude());
|
|
766
|
-
data.putDouble("longitude", geofence.getLongitude());
|
|
767
|
-
data.putDouble("radius", geofence.getRadius());
|
|
768
|
-
data.putBoolean("notifyOnEntry", geofence.getNotifyOnEntry());
|
|
769
|
-
data.putBoolean("notifyOnExit", geofence.getNotifyOnExit());
|
|
770
|
-
data.putBoolean("notifyOnDwell", geofence.getNotifyOnDwell());
|
|
771
|
-
data.putInt("loiteringDelay", geofence.getLoiteringDelay());
|
|
772
|
-
if (geofence.getExtras() != null) {
|
|
773
|
-
data.putMap("extras", jsonToMap(geofence.getExtras()));
|
|
774
|
-
}
|
|
775
|
-
rs.pushMap(data);
|
|
763
|
+
rs.pushMap(jsonToMap(geofence.toJson()));
|
|
776
764
|
}
|
|
777
765
|
success.invoke(rs);
|
|
778
766
|
} catch (JSONException e) {
|
|
@@ -789,25 +777,15 @@ public class RNBackgroundGeolocationModule extends ReactContextBaseJavaModule im
|
|
|
789
777
|
getAdapter().getGeofence(identifier, new TSGetGeofenceCallback() {
|
|
790
778
|
@Override public void onSuccess(TSGeofence geofence) {
|
|
791
779
|
try {
|
|
792
|
-
|
|
793
|
-
data.putString("identifier", geofence.getIdentifier());
|
|
794
|
-
data.putDouble("latitude", geofence.getLatitude());
|
|
795
|
-
data.putDouble("longitude", geofence.getLongitude());
|
|
796
|
-
data.putDouble("radius", geofence.getRadius());
|
|
797
|
-
data.putBoolean("notifyOnEntry", geofence.getNotifyOnEntry());
|
|
798
|
-
data.putBoolean("notifyOnExit", geofence.getNotifyOnExit());
|
|
799
|
-
data.putBoolean("notifyOnDwell", geofence.getNotifyOnDwell());
|
|
800
|
-
data.putInt("loiteringDelay", geofence.getLoiteringDelay());
|
|
801
|
-
if (geofence.getExtras() != null) {
|
|
802
|
-
data.putMap("extras", jsonToMap(geofence.getExtras()));
|
|
803
|
-
}
|
|
804
|
-
success.invoke(data);
|
|
780
|
+
success.invoke(jsonToMap(geofence.toJson()));
|
|
805
781
|
} catch (JSONException e) {
|
|
806
782
|
e.printStackTrace();
|
|
807
783
|
failure.invoke(e.getMessage());
|
|
808
784
|
}
|
|
809
785
|
}
|
|
810
|
-
@Override public void onFailure(String error) {
|
|
786
|
+
@Override public void onFailure(String error) {
|
|
787
|
+
failure.invoke(error);
|
|
788
|
+
}
|
|
811
789
|
});
|
|
812
790
|
}
|
|
813
791
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-background-geolocation",
|
|
3
|
-
"version": "4.14.
|
|
3
|
+
"version": "4.14.2",
|
|
4
4
|
"description": "The most sophisticated cross-platform background location-tracking & geofencing module with battery-conscious motion-detection intelligence",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "yarn run build:expo",
|