2011-10-20 55 views
0

我正在構建一個iPhone應用程序,該應用程序可以讀取上傳的視頻,上傳的照片和來自Facebook的帖子。 照片和視頻不是來自Feed,而是來自相冊。所以我爲我的應用程序獲得了一個訪問令牌,併爲照片和帖子起作用。但是,當我設法得到它返回我下面的錯誤視頻:使用Facebook API獲取視頻到iPhone應用程序

{ 「錯誤」:{ 「消息」:「用戶訪問令牌需要請求此資源」, 「類型」: 「OAuthException」 } }

以下權限,我使用的是:範圍= user_about_me,publish_checkins,read_stream,publish_stream,manage_pages,user_videos,offline_access,user_photo_video_tags,user_likes,user_checkins,rsvp_event,USER_LOCATION,publish_actions

誰能幫我?

回答

0

您對該請求使用哪個URL?

我能夠使用這個URL來檢索用戶上傳的視頻:https://graph.facebook.com/me/videos/uploaded?access_token=myaccesstoken

我用下面的權限:user_videos,offline_access,publish_stream。我認爲你只需要user_videos即可獲得用戶的視頻。

NSString *urlString = [NSString stringWithFormat:@"https://graph.facebook.com/me/videos/uploaded?date_format=U&access_token=%@",[authenticationKey_ stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; 
NSURL *url = [NSURL URLWithString:urlString]; 
videoRequest_ = [ASIHTTPRequest requestWithURL:url]; 
[videoRequest_ setDelegate:self]; 
[videoRequest_ startSynchronous]; 
+0

我正在使用應用程序訪問令牌,而不是使用acesstoken。但我認爲與用戶訪問令牌,你應該能夠檢索照片... – jonypz

+0

林不知道你指的是用戶訪問令牌和應用程序訪問令牌。但我使用相同的訪問令牌來檢索照片,檢索視頻,上傳照片和視頻,並且工作正常。 – calampunay

+0

http://stackoverflow.com/questions/7874301/facebook-api-bug @calampunay,如果你請回答這個問題 – jonypz

相關問題