victorbonnet / flutter_web_browser

Plugin for flutter to open web page with Chrome Custom Tabs and SFSafariViewController
MIT License
62 stars 39 forks source link

Adds redirect & close events via iOS delegate #37

Closed ened closed 2 years ago

ened commented 2 years ago

This way, clients can learn when the SafariViewController did a redirect or was closed (either by user or through code).

Simulator Screen Shot - iPhone 11 - 2021-07-20 at 13 38 20

ened commented 2 years ago

@victorbonnet hi there - here's a PR which adds a bit of functionality we required during a OAuth integration using this plugin. Please let me know any questions or change requests.

victorbonnet commented 2 years ago

Thanks @ened for the PR.

Do you know if those events could be returned for Android as well?

ened commented 2 years ago

@victorbonnet From my research, this only works well on iOS (with SFSafariViewController).

Chrome custom tabs have either:

My suggestion would be to merge & publish this and extend the Android side if Chrome custom tabs will get these features.

FYI, There is another PR planned which updates CCT to the latest version with light & dark mode theming support.

victorbonnet commented 2 years ago

Ok thanks for your research.

I would then suggest to rename FlutterWebBrowser.events() to FlutterWebBrowser.safariEvents() so that it's clear for the devs. What do you think?

ened commented 2 years ago

Ok thanks for your research.

I would then suggest to rename FlutterWebBrowser.events() to FlutterWebBrowser.safariEvents() so that it's clear for the devs. What do you think?

I think keeping events and extending it for CCT (or desktop browser, not checked yet) is OK. The documentation explains there are no events for CCT.

victorbonnet commented 2 years ago

Thanks @ened

I have merged and published the new version.

ened commented 2 years ago

Thank you @victorbonnet & I'll get to the CCT update next