mirror of
https://github.com/status-im/react-native.git
synced 2025-01-13 19:15:05 +00:00
PositionError must be an object, not string
Summary: As specifications says, the Position error must be an object with code and message attributes. Right now it is a string. If not, we can't know what kind of error is. Another issue is that the message must be exactly "No available location provider." Specifications: https://developer.mozilla.org/en/docs/Web/API/PositionError Closes https://github.com/facebook/react-native/pull/13140 Differential Revision: D4774922 Pulled By: ericvicenti fbshipit-source-id: f956af051461e9f8d6435496283e54b3c4dc8ef5
This commit is contained in:
parent
27c3e32abf
commit
94d93f7d41
@ -123,7 +123,7 @@ public class LocationModule extends ReactContextBaseJavaModule {
|
||||
(LocationManager) getReactApplicationContext().getSystemService(Context.LOCATION_SERVICE);
|
||||
String provider = getValidProvider(locationManager, locationOptions.highAccuracy);
|
||||
if (provider == null) {
|
||||
error.invoke("No available location provider.");
|
||||
emitError(PositionError.PERMISSION_DENIED, "No location provider available.");
|
||||
return;
|
||||
}
|
||||
Location location = locationManager.getLastKnownLocation(provider);
|
||||
|
Loading…
x
Reference in New Issue
Block a user