-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[webview_flutter] Add Android geolocation README #10166
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
[webview_flutter] Add Android geolocation README #10166
Conversation
Adds a section to `webview_flutter_android`'s README explaining how to enable geolocation. Fixes flutter/flutter#173279
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. |
There was a problem hiding this 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.
Your application must have geolocation permissions granted in order for the | ||
WebView to have access to geolocation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Adds a section to
webview_flutter_android
's README explaining how to enable geolocation.Fixes flutter/flutter#173279
Pre-Review Checklist
[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or I have commented below to indicate which version change exemption this PR falls under1.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style, or I have commented below to indicate which CHANGELOG exemption this PR falls under1.///
).Footnotes
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