Comments (8)
Same here, RN 0.40, cant get it to work..
from react-native-location.
Which RN version are you using? I'm using it with react-native 0.27 and it works fine.
from react-native-location.
@joegaudet - I got this to work just fine with v0.28. I've submitted a PR to make installation easier using react-native link
or rnpm link
- this properly links your library. However, I found I needed to add
<key>NSLocationWhenInUseUsageDescription</key>
<string>This is the plist item for NSLocationWhenInUseUsageDescription</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>This is the plist item for NSLocationAlwaysUsageDescription</string>
In order to get location data back. Other than that, the library seems to work great with v0.28 for me.
from react-native-location.
@joegaudet - Give the library a try with v0.28 by using the Example app added in PR #20 - once it's merged. Should work great [does for me].
from react-native-location.
Hi @joegaudet , I have same problem using react-native 0.40 + react-native-location 0.27. Did you find a solution?
from react-native-location.
Having the same problem with RN 0.41
from react-native-location.
I ended up using native google play code, pasting below for whoever is willing to adopt
public class MyLocation extends ReactContextBaseJavaModule {
GoogleApiClient client = null;
@ReactMethod
public void getLocation(final Callback errorCallback, final Callback successCallback) {
client = new GoogleApiClient.Builder(this.getCurrentActivity())
.addConnectionCallbacks(new GoogleApiClient.ConnectionCallbacks() {
@Override
public void onConnected(@Nullable Bundle bundle) {
Location lastLocation = LocationServices.FusedLocationApi.getLastLocation(client);
successCallback.invoke(lastLocation.getLatitude(), lastLocation.getLongitude());
}
@Override
public void onConnectionSuspended(int i) {}
})
.addOnConnectionFailedListener(new GoogleApiClient.OnConnectionFailedListener() {
@Override
public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {
errorCallback.invoke(connectionResult);
}
})
.addApi(LocationServices.API)
.build();
client.connect();
}
public MyLocation(ReactApplicationContext reactContext) {
super(reactContext);
}
@Override
public String getName() {
return "MyLocation";
}
}
from react-native-location.
Tracking in #35
from react-native-location.
Related Issues (20)
- subScribeLocationChanges() HOT 3
- 🔥 Method addObserver must be called on the main thread HOT 2
- Terrible accuracy - physial device Android 10, RN 0.6.4 HOT 3
- Is there any good and well-maintained alternative to this package? HOT 1
- Cant stop updates of RNLocation.subscribeToLocationUpdates HOT 1
- Not return heading HOT 2
- background configuration throwing error
- Failed to build android because of java classes HOT 9
- Wanings about some event emitters, about AddListener and removeListeners HOT 1
- subscribeToSignificantLocationUpdates doesn't work to me
- Undefined symbols for architecture arm64 HOT 1
- Requesting "always" permission when user has previously selected "whenInUse" causes request to hang (promise never resolves) (deprecate this library) HOT 2
- Failed to Build HOT 12
- Is this repo dead?
- RNLocation functions issue HOT 5
- nvert
- Error: package android.support.annotation does not exist HOT 2
- Not working when mobile in sleep mode[Android] HOT 1
- Error - Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'void
- Fatal Exception: java.lang.NullPointerException
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-location.