Skip to content
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

Feature: provide interface for controlling the advanced webview #17

Open
jonnysamps opened this issue Jun 29, 2017 · 9 comments
Open

Feature: provide interface for controlling the advanced webview #17

jonnysamps opened this issue Jun 29, 2017 · 9 comments

Comments

@jonnysamps
Copy link

I'm trying to use the advanced webview for an oauth workflow. The problem is that I need programatic access to the webview so that I can close it when the workflow completes. Right now it only allows user interaction to control it.

PS. I'd be happy to collaborate on it.

@bradmartin
Copy link
Owner

bradmartin commented Jun 29, 2017 via email

@jonnysamps
Copy link
Author

@jonnysamps
Copy link
Author

Also, I can't use the built-in webview because of Google's restricted requirements for OAuth.

@bradmartin
Copy link
Owner

bradmartin commented Jun 29, 2017 via email

@jonnysamps
Copy link
Author

Looks like you can close any active activity on Android if you have access to it. Just need to figure that part out. Disclosure: never written a native Android app.

I'll put together a PR.

@bradmartin
Copy link
Owner

bradmartin commented Jun 29, 2017

Poke around here on the android docs: https://developer.android.com/reference/android/support/customtabs/CustomTabsIntent.Builder.html - my quick glance didn't look promising on the API for customtabs - but yea closing the Chrome activity seems reasonable 👍 I wasn't thinking that direction to be honest.

@chrisbellman
Copy link

@jonnysamps trying to do something similar (use WebView to login / grab token from WebView then close WebView). How did you end up implementing?

@alexmeia
Copy link

Hello, any progress on this? I think this is a major issue for developers using advanced webview for OAuth authentication flow. Especially in iOS, the plugin should expose e method to closed automatically Safari View Controller after redirect to custom URL.

@etelford
Copy link

The way I handle this: from my web app that completes OAuth, I use an x-callback-url that my native app receives. Based on that, I dispatch an event globally to dismiss/close the SafariViewController.

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

No branches or pull requests

5 participants