SWIFT 3 解析 + FB 登入

SWIFT 3 Parse + FB Login

我想用“ParseFacebookUtilsV4”框架制作一个自定义登录按钮。

关于Parse的文档,应该是:

PFFacebookUtils.logInInBackgroundWithReadPermissions(permissions) {
 (user: PFUser?, error: NSError?) -> Void in
 if let user = user {
 if user.isNew {
 print("User signed up and logged in through Facebook!")
 } else {
 print("User logged in through Facebook!")
 }
 } else {
 print("Uh oh. The user cancelled the Facebook login.")
 }
}

错误是:

Use of unresolved identifier 'permissions'

你有什么想法吗?

您应该添加权限

let permissions = ["public_profile", "email", "user_friends"]
PFFacebookUtils.logInInBackground(withReadPermissions: permissions) { (user : PFUser?, error: Error?) in