无法从Facebook获取我需要的所有信息

时间:2016-07-06 14:36:53

标签: ios swift facebook facebook-graph-api

我正在使用FBSDK v2.4来授权和收集有关用户的信息。这是代码:

   private class func gatherUserData()
        {
            let parameters = ["fields": "id, about, birthday, email, first_name, gender, hometown, is_verified, last_name, locale, religion, timezone"]
            let manager = FBSDKGraphRequest(graphPath: "me", parameters: parameters, HTTPMethod: "GET")
            manager.startWithCompletionHandler { (connection, result, error) in

                if error == nil {
                    SocialParcer.parseFacebook(result)
                }
                else {
                    print(error)
                }
            }
        }

但我得到了这个(实际数据被替换):

{
    "first_name" = "Name";
    gender = male;
    id = "id";
    "is_verified" = 0;
    "last_name" = "Last Name";
    locale = "en_US";
    timezone = 5;
}

如您所见,超过一半的参数不存在。我该如何访问它们?

0 个答案:

没有答案