我已(我与火力地堡验证工作),当我在我的设备上运行我的应用程序,然后点击登录按钮,我得到错误信息登录页面与Facebook:离子火力Facebook的身份验证
此操作在运行此应用程序的环境中不受支持。 “location.protocol”必须是http或https,并且必须启用Web存储。
和错误代码是:
auth/operation-not-supported-in-this-environment
如果我在谷歌浏览器上运行这个程序,它的伟大的工作。哪里有问题?
感谢。
登录代码:
var provider = new firebase.auth.FacebookAuthProvider();
firebase.auth().signInWithPopup(provider).then(function(result) {
// This gives you a Facebook Access Token. You can use it to access the Facebook API.
var token = result.credential.accessToken;
// The signed-in user info.
var user = result.user;
console.log(user);
// ...
}).catch(function(error) {
// Handle Errors here.
var errorCode = error.code;
var errorMessage = error.message;
console.log(errorMessage);
console.log(errorCode);
var email = error.email;
// The firebase.auth.AuthCredential type that was used.
var credential = error.credential;
// ...
});
现在Cordova不支持signInWithPopup。作为解决方法,您可以使用Cordova的Facebook登录库,然后使用访问令牌调用signInWithCredential()。 –
我该怎么做?你有一个exapmle? @ChanningHuang – Ron