我想在我的应用程序中从Facebook获取用户的个人资料图片.我知道返回个人资料图片的http请求:
http://graph.facebook.com/USER-ID/picture?type=small
Run Code Online (Sandbox Code Playgroud)
但为此,我需要用户的用户ID.有没有办法在不使用Facebook SDK的情况下从某个地方获取?如果没有,有人可以告诉我一个简单的方法来获取用户的ID(或个人资料图片)?
试试这个...它在我的代码中运行良好..没有facebook id你不能得到..
还有一件事你也可以传递你的facebook用户名..
//facebookID = your facebook user id or facebook username both of work well
NSURL *pictureURL = [NSURL URLWithString:[NSString stringWithFormat:@"https://graph.facebook.com/%@/picture?type=large&return_ssl_resources=1", facebookID]];
NSData *imageData = [NSData dataWithContentsOfURL:pictureURL];
UIImage *fbImage = [UIImage imageWithData:imageData];
Run Code Online (Sandbox Code Playgroud)
谢谢 ..
| 归档时间: |
|
| 查看次数: |
10332 次 |
| 最近记录: |