0
我想從我的iOS應用向Facebook上傳視頻和我使用的代碼:的iOS FacebookSDK視頻上傳
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"sample" ofType:@"mp4"];
NSData *videoData = [NSData dataWithContentsOfFile:filePath];
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
videoData, @"video.mp4",
@"video/mp4", @"contentType",
@"Video Test Title", @"title",
@"Video Test Description", @"description",
nil];
[FBRequestConnection startWithGraphPath:@"me/videos"
completionHandler:^(FBRequestConnection *connection,
id result, NSError *error)
{
[FBRequestConnection startWithGraphPath:@"me/videos"
parameters:params
HTTPMethod:@"POST"
completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
if(!error)
{
NSLog(@"SUCCESS RESULT: %@", result);
}
else
{
NSLog(@"ERROR: %@", error.localizedDescription);
}
}];
但我得到的錯誤:
FBSDKLog:錯誤的請求到端點「我/視頻」:必須爲打到此端點的呼叫指定一個打開的FBSession。
錯誤:操作無法完成。 (com.facebook.sdk錯誤5.)
任何人都可以幫我嗎?
您是否設法解決此問題? –
我無法解決問題 – Rupshikha