[英]How to get thumbnail images from Facebook news feed using graph api?
[英]Facebook graph API iOS : How to get width and height of a feed picture?
[facebook requestWithGraphPath:@"me/home" andParams:params andDelegate:self];
我得到了這樣的結果:
“ ==========================================
“ id”:“ 619421723284_367295343463689”,
“來自”:{
“名稱”:“ ChED Ying”,
“ id”:“ 619421784”},
“ story”:“麥當勞(McDonald)新加坡的相片。”,
“ picture”:“ https://fbcdn-photos-a.akamaihd.net/hphotos-ak-ash3/542908_38595311133451268_195dfdd7739613_s.jpg”,
“ link”:“ https://www.facebook.com/photo.php?fbid=385953111451268&set=a.161567683889813.28585.157162220997026&type=1”,
“ name”:“ Wall Photos”,
“ ========================================
我知道如何通過將_s.jpg替換為_n.jpg來獲取提要圖片元素的大版本,但是圖片的大小不知道
。
有誰能夠幫助我?
謝謝。
您可以像這樣獲得圖像的寬度和高度:
NSData *data = [NSData dataWithContentsOfURL:[NSURL URLWithString: @"https://fbcdn-photos-a.akamaihd.net/hphotos-ak-ash3/542908_38595311133451268_195dfdd7739613_s.jpg"]];
UIImage *image = [UIImage imageWithData:data];
NSLog(@"%f, %f", image.width, image.height);
使用此API不可能,我嘗試了所有可能的字段;-(
這很煩人;-(
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.