-
Notifications
You must be signed in to change notification settings - Fork 664
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
Timeout deference between iOS and Android #285
Comments
It does seem like iOS implementation is more correct. The plugin handles geolocation implementation end-to-end for iOS. For Android, we only handle the permissions, not the actual implementation of geolocation. Instead we delegate to the webview implementation.
The fact that we have a
I agree that Android is more intuitive... I'd think timeouts are for acquiring the location point, and not because the user is taking their sweet time to accept or deny a permission prompt. But Apache aims to follow the W3C in hopes that eventually a plugin wouldn't be needed at all and can simply be removed without changing any app code, once the webview provides a suitable implementation. So Android (and iOS) implementations should be following W3C, and it sounds like Android implementation is in the wrong here. But I'm not sure if it's feasible to bring Android closer to W3C without providing a full e2e implementation, given the 2 noted caveats above. It would need to be investigated to be confirmed but if doing it the "proper" way leads to two permission requests, then I'd be more inclined to keep current behavior and document Android's behavior has an Android quirk. Also implementing the geolocation API directly in Android is going to be detrimental unless if we force google play services and use the google play location services API. The pure AOSP location API is not great and rather difficult to use since you have to manage different providers yourself. This is one of the main benefits of relying on the webview implementation on Android. |
Thank you for your kind reply. For workaround, iOS implementation (measure timeout in JavaScript) can be solution?: example for getCurrentPosition:
I think that measurement timeout in JS should be workaround for Android. There are 2 timeouts that generated in step 1 and passed in step 4, but step 5 uses only step 1 timeout because step 1 must be timeout before step 4. This is not comfortable to read code. |
This is sample (not tested yet) : master...kumo01GitHub:cordova-plugin-geolocation:fix/issues-285 |
Which is the way this Cordova plugin should be for Timeout?
I think iOS behavior is more reflective W3C, but Android behavior is intuitively useful.
The text was updated successfully, but these errors were encountered: