我正在尝试在 Chrome 扩展程序中实现 Firebase 登录(通过 Facebook)。
我在background.js脚本中使用以下代码
var ref = new Firebase("https://DB.firebaseio.com");
ref.authWithOAuthPopup("facebook", function(error, authData) {
alert(error);
});
Run Code Online (Sandbox Code Playgroud)
authData 为 null,出现的错误是“Firebase:用户取消了身份验证”。
使用电子邮件/密码登录似乎没有问题。
这里出了什么问题?
自https://www.firebase.com/blog/2014-10-03-major-updates-to-firebase-user-auth.html以来,在用myRef authUser我对用户进行身份验证后"simplelogin:userid"
我没有发现这个记录,这是正常的吗?我应该继续并删除"simplelogin:"部分以获取用户ID吗?
我需要执行以下操作
let array = [1, 2, nil, 3, nil, 4, 5]
var positions: [Int] = []
for (index, val) in array.enumerated() where val == nil {
positions.append(index)
}
print(positions) //gives [2, 4]
Run Code Online (Sandbox Code Playgroud)
无需for循环。可能吗?
firebase ×2
ios ×2
arrays ×1
cocoa-touch ×1
javascript ×1
swift ×1
text-styling ×1
uilabel ×1
xcode ×1