Cordova inAppBrowser won't work with firebaseAuth

北慕城南 提交于 2020-01-01 19:08:33

问题


I am building a hybrid app using the ionic framework.

I'm using angularFire 2.0 with Firebase 3.0. I have the cordova plugin "inAppBrowser" installed.

In the depreciated Firebase documents, that's all I need to have authWithOAuthPopup() fire up an inAppBrowser window and do the login process.

Currently, I am using signInWithPopup() and it does nothing in my iOS app. The app works fine in browser using ionic serve.


回答1:


Firebase 3.0 signInWithPopup/Redirect is not currently supported in a Cordova environment even with inAppBrowser plugin installed. Until this is supported, you can use other plugins to get the OAuth response for Facebook, Google and then use signInWithCredential instead. You can use something like https://www.npmjs.com/package/cordova-plugin-facebook to get the Facebook access token and then sign in via auth.signInWithCredential(firebase.auth.FacebookAuthProvider.credential(fbAccessToken));



来源:https://stackoverflow.com/questions/37937496/cordova-inappbrowser-wont-work-with-firebaseauth

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!