fluttercommunity / fluttercommunity/flutter_webview_plugin

onUrlChanged.listen never called on iOS

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

説明

## System info

Issue occurs on: iOS
Plugin version: xxx

#Problem

I am using onUrlChanged.listen in order to get the code of OAuth2 authentication. I get this code by listening to url changes, and it works fine on Android. When I launch it in iOS, I get a blank white screen. When I try to debug, I see that onUrlChanged.listen callback is never being called.

Here is my code:
void main() {
WidgetsFlutterBinding.ensureInitialized();
LoginController _loginController = new LoginController();
_loginController.getCodeWebView().then((FlutterWebviewPlugin flutterWebView) {
//deal here with webview and token request
flutterWebView.onUrlChanged.listen((String url) async {
if (url.length > 25) {
int endIndex = url.indexOf("&state");
if (url.contains("code=")) {
String code = url.substring(
url.indexOf('code') + 5, endIndex); //with "http://localhost:4200/
flutterWebView.close();
String accessToken = await _loginController.getAccessToken(code);
_loginController.decodeJwtAndPopulateUser(accessToken);
//Now that we have the token, we can instantiate layout with async calls that depends on token
runApp(
AppContainer(accessToken)
);
}
}
});
});
}

Can anyone help me please? I am struggling with it. I don't know if its a bug. I am testing it in iOS 13.3 and I already added the info.plist things to support webview_plugin:

`
NSAllowsArbitraryLoads

NSAllowsArbitraryLoadsInWebContent

`

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

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

調査の方向性

まず、報告されている onUrlChanged.listen の使用方法で iOS 13.3 上の OAuth2 フローを再現し、Android の動作と比較します。iOS におけるプラグインの URL 変更処理を追跡し、callback が発火する想定なのかを確認します。完了とは、動作が修正されているか、検証済みの説明とともに制限事項が文書化されていることを意味します。

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

評価

技術スタック
dart, flutter, ios
領域
mobile-dev
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

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

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