Skip to content

Conversation

stuartmorgan-g
Copy link
Collaborator

Adds a section to webview_flutter_android's README explaining how to enable geolocation.

Fixes flutter/flutter#173279

Pre-Review Checklist

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2 3

Adds a section to `webview_flutter_android`'s README explaining how to
enable geolocation.

Fixes flutter/flutter#173279
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds documentation to the webview_flutter_android README on how to enable geolocation. The changes include a new "Geolocation" section with an explanation, a code example, and a security warning. The PR also adds the corresponding example code and updates the package version and changelog. My review includes a suggestion to enhance the documentation by specifying the required Android permissions in AndroidManifest.xml and mentioning runtime permission handling, which will make it more complete and helpful for developers.

Comment on lines +129 to +130
Your application must have geolocation permissions granted in order for the
WebView to have access to geolocation.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The documentation mentions that the application needs geolocation permissions, but it doesn't specify which permissions are required or how to add them. This could be confusing for developers and lead to extra research time.

To make the documentation more helpful, I suggest adding the specific permissions required in AndroidManifest.xml and mentioning the need for runtime permission requests. This will provide a more complete guide for enabling geolocation.

Suggested change
Your application must have geolocation permissions granted in order for the
WebView to have access to geolocation.
Your application must have geolocation permissions granted for the
WebView to have access to geolocation. This requires adding the following
permissions to your AndroidManifest.xml file, located in
`<project>/android/app/src/main/AndroidManifest.xml`:
```xml
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

You may also need to request permissions at runtime. See the documentation for
the permission_handler package for details.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had considered this, but explicitly do not want us to be in the business of documenting exactly what the interaction between the system WebView and the Android permission system are, and maintaining that as they inevitably change.

Copy link
Contributor

@bparrishMines bparrishMines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@stuartmorgan-g stuartmorgan-g added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 7, 2025
@auto-submit auto-submit bot merged commit 16f88c3 into flutter:main Oct 7, 2025
80 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App p: webview_flutter platform-android
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[webview_flutter] Document Android geolocation prompt in README
2 participants