Skip to content

[webview_flutter][webview_flutter_android] Add android support for handling geolocation permissions #3475

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

Closed
wants to merge 0 commits into from

Conversation

yk3372
Copy link
Contributor

@yk3372 yk3372 commented Mar 16, 2023

This PR Add android support for handling geolocation permissions.
(WebChromeClient.onGeolocationPermissionsShowPrompt) api as a platform callback that notify the host application that web content from the specified origin is attempting to use the Geolocation API.

The host application should invoke the specified callback with the desired permission state.

Fixes flutter/flutter#27472

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [relevant style guides] and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/packages repo does use dart format.)
  • I signed the [CLA].
  • The title of the PR starts with the name of the package surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the [pub versioning philosophy], or this PR is [exempt from version changes].
  • I updated CHANGELOG.md to add a description of the change, [following repository CHANGELOG style].
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • All existing and new tests are passing.

@yk3372
Copy link
Contributor Author

yk3372 commented Mar 23, 2023

@bparrishMines @stuartmorgan hi, can you review my code? Thanks

@yk3372
Copy link
Contributor Author

yk3372 commented Mar 27, 2023

……

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.

Thanks for the contribution! I left some comments on the implementation.

I think you can remove the changes to webview_flutter. Since this feature is Android only, I don't think we need to include an example in webview_flutter. We don't want to have every platform specific feature used as an example in the app-facing package.

@yk3372
Copy link
Contributor Author

yk3372 commented Apr 10, 2023

I have finished it. Please review it again, thanks @bparrishMines

And why my dart format always fail to the rule? this wasted a lot of my time

@bparrishMines
Copy link
Contributor

@yk3372 The dart formatter was most likely failing because you were using an older version of Flutter. We develop plugins on the latest version of the main branch of flutter/flutter, so running the flutter_plugins_tools format command must be run while using the latest Flutter version.

It looks like this has the new Android lint errors from #3648. I'll update this PR after I update the pigeon version and lint errors in another PR.

@yk3372
Copy link
Contributor Author

yk3372 commented Apr 17, 2023

Thanks for the contribution! I left some comments on the implementation.

I think you can remove the changes to webview_flutter. Since this feature is Android only, I don't think we need to include an example in webview_flutter. We don't want to have every platform specific feature used as an example in the app-facing package.

please review again, thanks

@bparrishMines
Copy link
Contributor

I left a few more comments and updated the lint the Java code for the new lint warnings.

@yk3372
Copy link
Contributor Author

yk3372 commented Apr 21, 2023

I left a few more comments and updated the lint the Java code for the new lint warnings.

I have finish it, please review again, thanks

@yk3372
Copy link
Contributor Author

yk3372 commented Apr 22, 2023

I have made a wrong operation……

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

Successfully merging this pull request may close these issues.

[webview_flutter] Andriod WebView Geolocation Support
2 participants