我很难获取封面个人资料图片...
在这里,我得到了 profie 图像:
let userProfile = "https://graph.facebook.com/" + userId + "/picture?type=large"
let profilePictureUrl = NSURL(string: userProfile)
let profilePictureData = NSData(contentsOfURL: profilePictureUrl!)
if (profilePictureData != nil) {
let profileFileObject = PFFile(data:profilePictureData!)
currentUser.setObject(profileFileObject!, forKey: "profilePicture")
}
效果很好。
现在我在这里尝试获取封面图片:
let coverPicture = "https://graph.facebook.com/" + userId + "/cover?type=large"
let coverPictureUrl = NSURL(string: coverPicture)
let coverPictureData = NSData(contentsOfURL: coverPictureUrl!)
if (coverPictureData != nil) {
let coverFileObject = PFFile(data:profilePictureData!)
currentUser.setObject(coverFileObject!, forKey: "coverPicture")
}
但这似乎不起作用?!
如果有人可以提供帮助,请做:)