FBSDKGraphRequest不会返回first_name someties

时间:2016-04-21 10:07:58

标签: facebook-ios-sdk

对于某些用户,FBSDKGraphRequest工作,没有错误,但用户[" first_name"]为零。

我的代码:

  class func sessionStateChanged(token: String, viewController: UIViewController) {
// If the session was opened successfully
let request = FBSDKGraphRequest(graphPath: "me", parameters: ["fields": "email, first_name, last_name, gender"])
request.startWithCompletionHandler({(connection, user, error) -> Void in
  if (error==nil) {
    let params = [
      "uid": user["id"] as! String,
      "token": token,
      "user": [
        "login": user["email"] as! String,
        "billing_address_attributes": [
          "gender": user["gender"] as! String,
          "first_name": user["first_name"] as! String,
          "last_name": user["last_name"] as! String
        ]
      ]
    ]
  }
})

我在未经授权的情况下尝试用户,或者授权有限,我无法重现此问题。

我使用SDK iOS 4.11.0,最新的FBGraph版本,

1 个答案:

答案 0 :(得分:0)

打开此网址并查看developers.facebook.com/tools/explorer您可以查看来自facebook的结果