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

Listening for redirect #218

Open
willladislaw opened this issue Oct 29, 2018 · 1 comment
Open

Listening for redirect #218

willladislaw opened this issue Oct 29, 2018 · 1 comment

Comments

@willladislaw
Copy link

willladislaw commented Oct 29, 2018

Using WebView Plugin to launch facebook oauth connection flow. It seems user has to be logged-in first (see image) to display facebook oauth permission dialog.

One option will be to open facebook login screen then redirect back to app (on successful login) before launching oauth connection flow.

For this to work I need to be able to listen for a redirect from fb's login screen to fb's home screen (after login) at which point, return back to the app and launch connection flow. It seems plugin is not able to detect the redirect - plugin.onUrlChanged() is not triggered after authentication (redirect from login screen to home screen).

new FlatButton(
      child: const Text("Ok"),
      onPressed: () {
        launchWebView();

      }),


void launchWebView(){
    flutterWebviewPlugin.launch(
      'https://m.facebook.com/',
      withJavascript: true,
      withLocalStorage: true,
    );
//Not triggered
    flutterWebviewPlugin.onUrlChanged.listen((String changed) {
      if(changed.contains('https://m.facebook.com/home.php')){
        setState(() {
          //reload webview with connection flow url
        });
      }

    });
  }

enter image description here

@willladislaw willladislaw changed the title How to listen for a redirect on a third-party website (facebook) Listening for redirect Oct 29, 2018
@feelfreelinux
Copy link

Can confirm, i am unable to extract redirection from simillar oauth flow. Any progress? @slightfoot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants