-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FusedLocation.getFusedLocation() will not return a result if GPS is turned off #4
Comments
Hey! May I know which location priority setting were you using? |
I'm using FusedLocation.setLocationPriority(FusedLocation.Constants.HIGH_ACCURACY) |
even when I set it to BALANCED, it still behaves the same thing |
Alright. What I believe is happening is, in the emulator you don't have the hardware for Cell Towers that is supposed to get your location if the GPS is turned off. |
I'm running into this issue on the Android emulator too. I have a part of my app relying on getting a response back from the |
@jordanmkoncz I understand it's an issue and I'm surely gonna work on it when I get time. And I really appreciate the patience. :) |
you can check gps service like this
|
@MustansirZia anyupdate on time out ? |
@jarvisluong @jordanmkoncz @sumesh1993 Okay. Added a check in 0496936 for |
@MustansirZia thanks, I'll be keen to check that out. Can you update the README to show/explain how to handle this case where The example code does It would be helpful to have the above clearly explained in the README, and for the example code to show how you would correctly handle the situation where |
@jordanmkoncz Let me update the README. But for you to state it quickly, an error would be thrown and it would need to be caught in a |
@MustansirZia I just had a chance to do some testing of the new version of the package ( I do still have an issue though. When I have Location Services enabled in my emulator, the code reaches My emulator is a Nexus 5 running API 23 (x86). I'm not exactly sure why |
@jordanmkoncz Alright. If I may ask you a couple of things before we move ahead. |
@MustansirZia sorry I haven't been able to get back to you on this, I've been working on another project that doesn't use this library. I probably won't get a chance to do more testing and answer all your questions until a few weeks from now. I'll try to give you some answers in the meantime.
I did test it on a real device and the library worked correctly, but that was with Location Services enabled. I'm not sure exactly how I'd test for the error condition on a real device, I guess I'd have to turn off Location Services and also turn off something so that it can't get my location from Cell Towers either?
I only have the Nexus 5 emulator set up right now so I wasn't able to test it in any other emulators.
I think I did try this, but I can't remember for sure.
I didn't try using I know those aren't the answers you were wanting, but hopefully that's helpful. :) |
I'm experiencing something similar. On the emulator. If the locations is on at the start of the build. Everything works fine. But if you turn off then on the location services. It just keeps loading but not returning anything. I haven't tested this yet on an actual device. May just be a emulator problem. Reference: facebook/react-native#16903 |
Just thought I should comment here. Have added Maybe call this method and check for a |
Hi! I think this issue is now resolved, should we close it now? |
Please do. |
Hi!
I used a case with Genymotion emulator and turn off GPS. After the app is loaded. I check and found that the function FusedLocation.getFusedLocation() never return a resolve or reject.
I think that would be a great idea to implement a timeout to know if the GPS is turned off or not.
The text was updated successfully, but these errors were encountered: