Skip to content

[webview_flutter] Andriod WebView Geolocation Support #27472

Description

@vail130

Please add support for geolocation inside of the webview for Android.

Apparently, this is not an issue for iOS, because UIWebViews automatically get location information once the app has the right permissions. With Android, however, the WebView must us a customized WebChromeClient to access location information.

Here are a few relevant links:

  1. https://stackoverflow.com/a/5423026
  2. https://turbomanage.wordpress.com/2012/04/23/how-to-enable-geolocation-in-a-webview-android/
  3. https://medium.com/@xabaras/android-webview-handling-geolocation-permission-request-cc482f3de210

Activity

  1. kangwang1988 commented on Feb 5, 2019

    @kangwang1988
    Contributor

    Would a combination of webview plugin(webview_flutter) & location plugin(location_background) will be proper to resolve this issue?
    @vail130

  2. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Feb 5, 2019
  3. zoechi commented on Feb 7, 2019

    @zoechi
    Contributor

    https://pub.dartlang.org/packages/geolocator seems to be handling geolocation permissions.

  4. StefanoGR commented on Mar 5, 2019

    @StefanoGR
  5. no-response commented on Mar 5, 2019

    @no-response

    Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. Please don't hesitate to comment on the bug if you have any more information for us; we will reopen it right away!
    Thanks for your contribution.

  6. lucianoiam commented on Mar 10, 2019

    @lucianoiam

    @vail130 @StefanoGR Meanwhile an official solution for geo on Android is added, you can try my fork at https://github.com/iamluciano/plugins

    See pull request for further information flutter-team-archive/plugins#1330

  7. ShadyBoukhary commented on Apr 8, 2019

    @ShadyBoukhary
  8. lucianoiam commented on Apr 8, 2019

    @lucianoiam

    Hi @ShadyBoukhary , unfortunately my pull request was not approved (flutter-team-archive/plugins#1330) and then I had to pause further development because I hit an unrelated issue which is a deal breaker for me (#19718). If you really need geolocation on Android, you might try my outdated fork. There is a link in the comment right before yours. Do not forget to ask for geo permissions, the PR has some instructions.

  9. ShadyBoukhary commented on Apr 8, 2019

    @ShadyBoukhary

    @iamluciano thanks for the reply. The WebView in my case isn't necessary. It was just an easy way to use Google Maps for quick navigation. I think I'm just going to use the native Google maps plugin instead as I would prefer to keep using an updated version of flutter.

  10. NewITCorp commented on Aug 10, 2019

    @NewITCorp
  11. 10 remaining items

  12. djks74 commented on Sep 16, 2021

    @djks74
  13. oander11 commented on Sep 21, 2021

    @oander11
  14. djks74 commented on Oct 4, 2021

    @djks74
  15. flutterbest commented on Feb 16, 2022

    @flutterbest
  16. djks74 commented on Feb 16, 2022

    @djks74
  17. florianliebig commented on Aug 16, 2022

    @florianliebig
  18. DasunInduwara commented on Mar 15, 2023

    @DasunInduwara
  19. github-actions commented on Jun 29, 2023

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  20. locked as resolved and limited conversation to collaborators on Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: new featureNothing broken; request for a new capabilityp: webviewThe WebView pluginpackageflutter/packages repository. See also p: labels.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions