Skip to content
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

Package is not production ready for Android #102

Closed
mulderpf opened this issue Jan 5, 2019 · 6 comments
Closed

Package is not production ready for Android #102

mulderpf opened this issue Jan 5, 2019 · 6 comments

Comments

@mulderpf
Copy link

mulderpf commented Jan 5, 2019

I used this library in a production version of my app and approximately 25% of all my Android users suffered with an issue where:

try {
  currentLocation = await location.getLocation;
} on PlatformException {
  currentLocation = null;
}

would immediately throw a PlatformException and keep doing so for about 40-60 seconds until it seems like the GPS has warmed up. Unfortunately due to having to rush in a patch to figure out what was going on, I only captured e.code which was always "ERROR". I didn't pick this up in testing until my users reported the issue - the easiest way to recreate it is to turn off location services, attempt to get location, turn it back on and then this horrible mess starts.

I would not expect this plugin to work this way on Android and at least make an attempt at getting location rather than just throwing an error. On Android native I had a timeout of 20 seconds which has been sufficient for hundreds of thousands of devices since 2013.

I've replaced this with the geolocator package (https://pub.dartlang.org/packages/geolocator) using the "best" location accuracy and I haven't seen this issue re-occur. Similarly, in my attempt to recreate the issue where location would resume after about 40-60 seconds, the other plugin does it in about 15 seconds.

@OddBlueDog
Copy link

OddBlueDog commented Jan 8, 2019

I think this is related to: #82

I'm waiting out till location is supported officially. All the plugins I've tried have one issue or another.

@mulderpf
Copy link
Author

mulderpf commented Jan 9, 2019

Since switching to geolocator, I've not seen further production issues (app is used by around 2700 people per day with the vast majority of them choosing to use location services).

The issue report is possibly the same, but in my testing, the device recovered after about 40-60 seconds.

@OddBlueDog
Copy link

I found geolocator quite slow compared to this one (when this one works), maybe I had the accuracy higher on geolocator? Is your app published to Apple App store or only the Play Store? I also got some weird email from Apple after using geolocator about various "Missing Purpose String in Info.plist File".

@mulderpf
Copy link
Author

My app is published to both. All my purpose strings are completed in the Info.plist file for the permissions I require in the app. That needs to be setup if you use location services regardless of which plugin you use to obtain it.

The only time geolocator is slow, is when the phone is trying to obtain a GPS fix. But that's normal and if I am using an "await" statement, I expect the app to at least try and get the fix, rather than return a PlatformException. Being really fast in returning a PlatformException isn't useful to me.

@fvisticot
Copy link

Any update of this issue. I have the same issue the plugin is workin on some Android devices and is failing on other one (Samsung A5 is not working)

@Lyokone
Copy link
Owner

Lyokone commented Mar 16, 2019

Hey ! The plugin should be more reliable with the latest 2.1 version. Please check it out :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants