radarlabs / react-native-radar

React Native module for Radar, the leading geofencing and location tracking platform
https://radar.com
Apache License 2.0
170 stars 32 forks source link

Android is not giving location accuracy #124

Closed profburial closed 3 years ago

profburial commented 4 years ago

Summary

Right now the android client is only sending latitude, longitude, and altitude with location updates

{
    "source": "FOREGROUND_LOCATION",
    "stopped": false,
    "location": {
        "altitude": 67.03832244873047,
        "longitude": -93.27348929778182,
        "latitude": 37.301360527135444
    }
}

Whereas on iOS I see

{
    "stopped": false,
    "location": {
        "course": 184.57,
        "speed": 2.41,
        "longitude": -122.03255055,
        "verticalAccuracy": -1,
        "latitude": 37.33517518,
        "courseAccuracy": -1,
        "speedAccuracy": 0,
        "altitude": 0,
        "accuracy": 5
    },
    "source": "FOREGROUND_LOCATION"
}

Code to reproduce

Radar.getLocation();

Steps to reproduce

Get user's location on android

OS version

Android 10

SDK installation method

https://radar.io/documentation/sdk/react-native#install

SDK version

3.0.6

Other information

Android permissions

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
nickpatrick commented 3 years ago

@profburial I included #125 in 3.1.0, give it a shot and let us know if that fixes it.

profburial commented 3 years ago

Looks good to me!