在升级到 Angularfire 0.9 之前我已经完美地工作了
我想从 Facebook 请求用户的电子邮件地址。 Facebook 已允许我向我的用户索取此信息。我正在使用下面的代码登录 Facebook。一切都完美地接受它不要求用户的电子邮件。
仅供参考:我正在使用 Angularfire 种子代码库
loginWithFacebook: function() {
return auth.$authWithOAuthPopup("facebook", function(error, authData) { /* Your Code */ }, {
remember: "sessionOnly",
scope: "email, user_likes"
});
},
提前致谢!
作为对下面迈克的回答的回应,我注意到该函数根本不运行。不确定问题是什么。
var ref = new Firebase("https://<your-firebase>.firebaseio.com");
ref.$authWithOAuthPopup("facebook", function(error, authData) {
//THIS CODE NEVER RUNS
if (error) {
console.log("Login Failed!", error);
} else {
console.log("Authenticated successfully with payload:", authData);
}
});