-
Notifications
You must be signed in to change notification settings - Fork 68
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
Add closeAllIfPossible() method #67
Add closeAllIfPossible() method #67
Conversation
b82aee4
to
842c0dc
Compare
The CI failed due to the dependency specification. I think that we need to push the contents on this branch to pub.dev for the CI to be succeeded. |
842c0dc
to
45c50e7
Compare
Thank you so much for this, exactly what I needed. I'm also using deep links to hide the custom tabs on Android, works perfectly. For iOS there seems to be no other way than what you have done here to close the custom tabs (I tried all kinds of javascript & deep link shenanigans). I had to download it locally and edit the pubspec files to get the dependencies to work like you said - not sure how to correctly fix it though so it'd work in the CI. Just wanted to thank you for this valuable feature. |
Hello @em-yhoshino,
Actually
What am i doing wrong? Is it possible to test it or am i supposed to wait for @droibit to merge into a new officiale version? |
Thank you for the PR! This plugin has not been maintained for a long time I will fix the workflows later. |
Thank you so much for coming back to this project! Looking forward to being able to use this version (not the fork) again once it's live on pub.dev :) |
The latest v1.11.0 with this PR has just been published on pub.dev! Thank you for your patience. |
You're the best, thank you! |
What is this?
I have added closeAllIfPossible(), which closes all launched SFSafariViewControllers via flutter_custom_tabs, to launcher.
Before this PR
Once the app launched a SFSafariViewController via flutter_custom_tabs, it could not be closed until the user closed it. Therefore, the SFSafariViewController was masking the deep link transition.
After this PR
The app can close all SFSafariViewController at any time.
It is especially useful before deep link transitions.
How to use
Like this,
It avoids occuring a transition behind a SFSafariViewController that is not closed by user.
Android and web
In Android and web, empty operations have been implemented because there is no proper way to close customTabs.
At least, Android doesn't require it in case of deep link scenario.
This is because customTabs are automatically closed when app returns from background.