问题描述
我正在尝试借助firebase"身份验证在我的 ionic 3 应用中实现社交登录.我关注了这篇文章 https://javebratt.com/ionic-social-login-firebase/一个>
I am trying to implement social login in my ionic 3 app with the help of 'firebase' authentication. I followed this artical https://javebratt.com/ionic-social-login-firebase/
我安装了所有插件(cordova-plugin-browsertab、cordova-plugin-inappbrowser ..etc)和文章中的完全一样.
I installed all the plugins(cordova-plugin-browsertab,cordova-plugin-inappbrowser ..etc) and did exactly same as in the article.
然后我在 android 和 ios 设备上运行该应用程序.在 android 设备中,facebook/google 登录页面在应用内浏览器"中打开,并在登录过程后成功重定向到应用.一切正常.
Then I ran the app on both android and ios devices. in android device the facebook/google login page is opened in the 'in app browser' and it is redirected to the app successfully after the login process.everything works fine.
但在 iPhone 中,facebook/google 登录页面是在新的 safari 浏览器实例中打开的,登录后它会重定向到 localhost,而不是重定向回应用程序.
But in the iPhone the facebook/google login pages are opened in a new safari browser instance and after the login it redirect to localhost, and it is not redirected back to the application.
谁能帮我解决这个问题?
can anyone help me with this?
谢谢
推荐答案
我认为这个问题与 iOS 中的 ionic 有关,现在默认为 WKWebView (http://ionicframework.com/docs/wkwebview/) 与 Firebase 有问题.iOS 中的 ionic 原生应用 URL 现在显示为 http://localhost 而不是 file://assets/.../index.html.
I believe the issue is related to ionic in iOS now defaulting to WKWebView (http://ionicframework.com/docs/wkwebview/) which has issues with Firebase. ionic native app URLs in iOS now appear as http://localhost instead of file://assets/.../index.html.
此时建议的解决方法是降级到 UIWebView.Firebase Auth 正在为此寻找解决方案.
The suggested workaround at this time is to downgrade to UIWebView. Firebase Auth is looking into a solution for this.
这篇关于firebase 社交登录未重定向到应用程序,离子 3,ios的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!