我有一个使用 Facebook SDK for iOS 将本机(MOV 文件)视频发布到 Facebook 的应用程序。直到几周前它开始没有问题,它开始失败并出现以下错误:
error = {
code = 352;
message = "(#352) Sorry, the video file you selected is in a format that we don't support.";
type = OAuthException;
};
完整的错误字符串是:
错误 Domain=com.facebook.sdk Code=5 “操作无法完成。(com.facebook.sdk 错误 5。)” UserInfo=0x1ea42880 {com.facebook.sdk:HTTPStatusCode=400, com.facebook.sdk :ParsedJSONResponseKey={ body = { error = { code = 352; message = "(#352) 抱歉,您选择的视频文件格式我们不支持。"; 类型 = OAuthException; }; }; 代码 = 400; headers = ( { name = "Access-Control-Allow-Origin"; value = "*"; }, { name = "Cache-Control"; value = "no-store"; }, { name = Connection; value =关闭;},{名称=“ 内容类型"; value = "text/javascript; charset=UTF-8"; }, { name = Expires; value = "Sat, 01 Jan 2000 00:00:00 GMT"; }, { name = Pragma; value = "no-cache"; }, { name = "WWW-Authenticate"; value = "OAuth \"Facebook Platform\" \"invalid_request\" \"(#352) 抱歉,您选择的视频文件格式我们不支持。\""; } , { name = "x-fb-loadmon"; value = "0,30,70"; } ); }, com.facebook.sdk:ErrorSessionKey=, expirationDate: 4001-01-01 00:00:00 +0000 ,刷新日期:2013-10-15 17:19:33 +0000,尝试刷新日期:
我用来发布的代码与此类似:
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
videoData,@"video.mov",
@"video/quicktime", @"contentType",
title, @"title",
status, @"description",
nil];
FBRequest* request = [FBRequest requestWithGraphPath:[NSString stringWithFormat:@"%@/videos",@"me"]
parameters:params
HTTPMethod:@"POST"];
[request setSession:session];
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0ul);
dispatch_async(queue, ^{
dispatch_async(dispatch_get_main_queue(), ^(void) {
[request startWithCompletionHandler:^(FBRequestConnection* conn, id data, NSError* error){
SSLog(@"DONE!");
[self processResponseWithData:data requestIdentifier:requestIdentifier andError:error];
}];
});
});
我已更新到最新的 SDK 版本(3.9),但错误仍然存在。任何机构都遇到此错误?
我正在使用 iOS6 和 iOS7 进行测试,所以问题与操作系统版本无关。相同的视频使用 iOS-Facebook 内置功能上传 okey。
非常感谢!