Cordova inAppBrowser不能与firebaseAuth一起使用 [英] Cordova inAppBrowser won't work with firebaseAuth

查看:176
本文介绍了Cordova inAppBrowser不能与firebaseAuth一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用离子框架构建一个混合应用程序。

我使用的是Firebase 3.0的angularFire 2.0。我已经安装了inAppBrowser的cordova插件。



在折旧的Firebase文档中,我只需要authWithOAuthPopup()启动一个inAppBrowser窗口并执行登录过程即可。



目前,我正在使用signInWithPopup(),它在我的iOS应用程序中什么都不做。
该应用在使用离子发球的浏览器中工作正常。

解决方案

Firebase 3.0 signInWithPopup / Redirect当前不支持科尔多瓦环境,甚至安装了inAppBrowser插件。
在支持这个功能之前,您可以使用其他插件获取Facebook,Google的OAuth响应,然后使用signInWithCredential。你可以使用像 https://www.npmjs.com/package/cordova-plugin- Facebook 获取Facebook访问令牌,然后通过auth.signInWithCredential(firebase.auth.FacebookAuthProvider.credential(fbAccessToken))登录;


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.

解决方案

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));

这篇关于Cordova inAppBrowser不能与firebaseAuth一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆