fluttercommunity / fluttercommunity/flutter_webview_plugin

Listening for redirect

オープン
#218 コメント 1 件 リアクション 2 件 担当者 0 名 GitHub で見る
Requires Review
主要言語
Java
スター
1.5k
フォーク
938
PR マージ指標
30日以内にマージされた PR はありません

説明

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][1]][1]

[1]: https://i.stack.imgur.com/QTeLw.png

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

launchWebView() から flutterWebviewPlugin.launch() を使用して Facebook のログインフローを再現し、続いてログインから home.php へのリダイレクト中に plugin.onUrlChanged listener を追跡します。認証後にリダイレクトが検出され、アプリが戻って接続フローを起動できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
dart, flutter
領域
authentication, mobile
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。