我有一个方法,其中结果可变,但我无法从那里获取电子邮件、姓名等值...
func getFBUserData(){
if((FBSDKAccessToken.currentAccessToken()) != nil){
FBSDKGraphRequest(graphPath: "me", parameters: ["fields": "name, email"]).startWithCompletionHandler({ (connection, result, error) -> Void in
if (error == nil){
print(result)
}
})
}
}
我尝试了一些编码,但总是出错。结果的结构如下。
{email = "xy@icloud.com";
id = xxx;
name = "name surname";}
如何将其作为数组获取?
最佳答案
对不起。我实在是太蠢了。
print(result["email"], result["name"])
关于facebook - 快速登录facebook,无法获取值,,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33283945/