-
Notifications
You must be signed in to change notification settings - Fork 147
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
How to close browser tab? #4
Comments
I think we need to use dismissViewController method. See http://strawberrycode.com/blog/sfsafariviewcontroller-and-oauth-the-instagram-example/ |
This isn't something you can reliably do across platforms and browsers. Dismissing the tab isn't required for OAuth, all that matters is that the response is ultimately delivered to the requesting app. |
True but consider scenario:
Bob is frustrated: to him it looks like the app is not working, even though if he taps 'Done' button he would sign in to the app. |
I'm looking for a way to achieve this on Android. My situation is as follows: Any ideas? |
@mjwwit I believe you need to add |
@gregor-srdic Ok, do you know how to configure this? I've been reading https://cordova.apache.org/docs/en/latest/config_ref/ but I can't find anything that looks like what I need. |
@mjwwit Google achieves closing the extra browser WebView with Firebase OAuth as documented here: https://firebase.google.com/docs/auth/web/cordova I'm trying to figure out how to do it the same way. However, it's in a different project. firebase/firebase-js-sdk#102 I will post my findings here once it's found. |
@gregor-srdic |
@gregor-srdic & @mjwwit , we were very close. |
Looks like @washowasho found the solution. The |
@washowasho Do you have any tips on how to close the browser tab on iOS? Feel like I've tried everything at this point:
None of the above closes the tab on iOS. Pretty much all of them closes the tab on Android. Hope you have a pointer or two. |
Try this. It works for me using custom URL scheme.
|
Thanks, that did something. But the user is presented with a small popup asking if he wants to open in our app, which, in an OAuth flow, is less than desired. Anyway thank you for your time, I'll go to plan B, which is use this for Android, and cordova-plugin-safariviewcontroller for iOS. |
Hi! Any new about this? |
Washowasho's solution works for me. Here is my working code for ASP.Net Core 3.1. It redirects your request with query string to the same page immediately after the page loads. It means the window.close() works because the location is navigated by javascript.
|
It looks that there is no way to close the browser tab. I think this is required to implement the OAuth flow.
The text was updated successfully, but these errors were encountered: