Comments (13)
@rayj10 Yes i use react-native-firebase, but not with messaging yet. This is part of my build.gradle:
implementation "com.google.android.gms:play-services-base:12.0.1"
implementation "com.google.firebase:firebase-core:12.0.1"
implementation "com.google.firebase:firebase-auth:12.0.1"
implementation "com.google.firebase:firebase-database:12.0.1"
implementation 'com.google.android.gms:play-services-location:12.0.1'
from react-native-geolocation-service.
No, I meant emulator will not give you the actual location. It'll always return the same position that you entered. If you want to test your actual current position, you're gonna need a real device.
from react-native-geolocation-service.
You have to use same version for each of those libraries. Try using 12.0.1 for all of them, 15+ probably won't work if gradle tools version is lower than 3.3 I think.
from react-native-geolocation-service.
Thanks for the prompt reply! and I tried just deleting the apply plugin part, it got ur lib to work but not sure if it affects the firebase. The thing is firebase specifically ask for 15.0.1 but in some forum it has been known that the apply plugin line could cause problems. I just have to test it first if both ur lib and firebase could work using the current setup properly. If not I'll try ur solution using 12.0.1 and report back.
Thanks for the lib! It really solved the problem with RN's geoloc and saved me lots of time 😄
from react-native-geolocation-service.
I use 12.0.1 for all libs and that works for me.
from react-native-geolocation-service.
You can continue to use 15.0.1 along with react-native-firebase; just make sure you configure your project-wide gradle configuration properties and update app/build.gradle
appropriately.
ex:
/**
+ Project-wide Gradle configuration properties
*/
ext {
compileSdkVersion = 25
targetSdkVersion = 25
buildToolsVersion = "25.0.2"
supportLibVersion = "25.0.1"
googlePlayServicesVersion = "15.0.1"
}
from react-native-geolocation-service.
@oakis U mean it works for both this lib and firebase messaging like the one I'm trying to use?
Because I'm aware that this lib can work with anything 11+ but the problem is if the firebase part of my code will since they don't really mention it in the docs
@nickarora sounds good I will try adding that partto my project level gradle. I tried adding ext {} yesterday but it gave me error, I think my problem is I'm not sure what to look for in my app level gradle to "update properly" as u mentioned. Sorry I'm pretty new to this, this is the first project that I have to do these stuff manually for RN. 😅
Thanks for the pointers everyone! 😄
from react-native-geolocation-service.
@oakis cool, I'll try that out then, seems like thats gotta be the optimum solve. Thanks heaps! 😄
from react-native-geolocation-service.
So I tried writing my app and project level gradle like the following (based on everyone's recommendations combined):
app level
dependencies {
//RNGeolocServices
implementation "com.google.android.gms:play-services-location:$rootProject.googlePlayServicesVersion"
implementation project(':react-native-geolocation-service')
//firebase
implementation "com.google.android.gms:play-services-base:$rootProject.googlePlayServicesVersion"
implementation "com.google.firebase:firebase-core:16.0.1"
implementation "com.google.firebase:firebase-messaging:17.1.0"
implementation 'me.leolin:ShortcutBadger:1.1.21@aar'
project level
ext {
compileSdkVersion = 27
targetSdkVersion = 27
buildToolsVersion = "27.0.3"
googlePlayServicesVersion = "15.0.1"
}
It solved the original error but giving me this error upon accessing device location:
{message: "Google play service is not available.", code: 4}
UPDATE:
I updated my emulator to API24 so it has google play store by default and can update google play services automatically and it solved the above error. But now I'm getting this instead:
{message: "Location request timed out.", code: 3}
`
Any suggestion what I should try next?
thanks in advance guys for the help and patience with my lack of experience 😅
from react-native-geolocation-service.
You have to turn on GPS in your emulator, although testing on emulator won't do you any good since it'll give you a mock location. You have to test on a real device.
from react-native-geolocation-service.
You can use the emulator as well, just put in coordinates manually and press send. Then test your app and it should receive the location.
from react-native-geolocation-service.
@Agontuk So the one returned on emulator will always be mock regardless of the "allow mock" toggle on the settings?
I assume the mock property returned by getCurrentPosition()
is just checking whether or not allow mock setting is turned on then?
@oakis I'm receiving the location just fine after I fixed the above problem, the problem was apparently I need to put the third argument for the getCurrentPosition()
that has these { enableHighAccuracy: true, timeout: 2000, maximumAge: 3600000 }. Not sure if the success is dependent on enableHighAccuracy
being true as some other forum posts said...
Thanks for the amazing support and prompt replies guys! 😄
from react-native-geolocation-service.
@Agontuk Thanks for the prompt replies and guidance! 😄 closing this now..
from react-native-geolocation-service.
Related Issues (20)
- Not getting location prompt while opening the app for ionic3
- Geolocation.getCurrentPosition always returns San Fransisco lat/long HOT 1
- Receiving longitude and latitude as 0
- Latitude is coming as 0 in ios where longitude has a valid value HOT 5
- Unable to get the current location in Android when we are using wifi HOT 2
- watchID always 0 when i called watchPosition HOT 2
- React-native-geolocation-service failing when building on xcode it says "underlying Objective-C module 'react_native_geolocation_service' not found", "failed to verify module interface of 'react_native_geolocation_service' due to the errors above; the textual interface may be broken" HOT 2
- GPS accuracy lack HOT 1
- Crash on Xcode 15 RC
- watchPosition not working consistently on iOS
- upgrading to googlePlayServicesVersion 21.0.1 HOT 2
- Only update location once every 5 minutes not working as expected
- Search for location in the background - Android HOT 3
- In latest React-native 0.73 version it gives error of gerCurrentPosition not defined when i use same code react-native lesser version it works perfect but in the latest version it doesn't work
- Restricting to multiple countries? HOT 1
- Swift Requirement and iOS 12 crashes
- Could not invoke RNFusedLocation.startObserving HOT 2
- [TypeError: Cannot read property 'getCurrentPosition' of null] HOT 4
- GooglePlayServicesMissingManifestValueException at getCurrentPosition()
- Usage of Insecure random generator (Instances of java.util.Random) found in Testing.
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-geolocation-service.