fluttercommunity / fluttercommunity/flutter_webview_plugin
Listening for redirect
- Langage dominant
- Java
- Étoiles
- 1.5k
- Forks
- 938
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
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
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Reproduire le flux de connexion Facebook depuis launchWebView() avec flutterWebviewPlugin.launch(), puis suivre le listener plugin.onUrlChanged pendant la redirection de la connexion vers home.php. C’est terminé lorsque la redirection est détectée après l’authentification et que l’application peut revenir pour lancer le flux de connexion.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- dart, flutter
- Domaine
- authentication, mobile
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100