简体   繁体   English

收到错误消息“操作无法完成。 (com.facebook.sdk错误5。)',当从iphone在Facebook上发布视频时

[英]Getting error 'The operation couldn’t be completed. (com.facebook.sdk error 5.)' when Posting video on facebook from iphone

I'm getting an error(The operation couldn't be completed. (com.facebook.sdk error 5.))when posting video from ios device. 从ios设备发布视频时出现错误(操作无法完成。(com.facebook.sdk错误5。)。 I have used these code for posting video on facebook. 我已经使用这些代码在Facebook上发布了视频。

-(void)FBUploadVideoProcess
{
    NSString *finalFileName=[NSString stringWithFormat:@"Documents/Book_%d/%@_%d.mov",self.book.bookId,self.book.bookName,self.book.bookId];
    NSString *filePathOfVideo = [NSHomeDirectory()
                             stringByAppendingPathComponent:finalFileName];
    NSData *videoData = [NSData dataWithContentsOfFile:filePathOfVideo];
    NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                               videoData, @"animation1.mp4",
                               @"video/quicktime", @"contentType",
                               self.book.bookName, @"name",
                               @"FlipIt Movie", @"description",
                               nil];

   if (FBSession.activeSession.isOpen)
   {
       [FBRequestConnection startWithGraphPath:@"me/videos"
                                 parameters:params
                                 HTTPMethod:@"POST"
                          completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
                              if(!error)
                              {
                                  NSLog(@"RESULT: %@", result);
                                  UIAlertView *alrtResult=[[UIAlertView alloc]initWithTitle:@"FlipIt" message:@"Upload Complete." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
                                  [alrtResult show];

                                  [spinner stopAnimating];

                              }
                              else
                              {
                                  NSLog(@"ERROR: %@", error.localizedDescription);
                                  UIAlertView *alrtResult=[[UIAlertView alloc]initWithTitle:@"FlipIt" message:error.localizedDescription delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
                                  [alrtResult show];
                                  [spinner stopAnimating];

                              }
                          }];
    }
    else
    {
        NSArray *permissions = [[NSArray alloc] initWithObjects:
                            @"publish_actions",
                            nil];
    // OPEN Session!
        [FBSession openActiveSessionWithPublishPermissions:permissions defaultAudience:FBSessionDefaultAudienceEveryone  allowLoginUI:YES
                                     completionHandler:^(FBSession *session,
                                                         FBSessionState status,
                                                         NSError *error) {
                                         if (error)
                                         {
                                             NSLog(@"Login fail :%@",error);
                                             UIAlertView *alrtResult=[[UIAlertView alloc]initWithTitle:@"FlipIt" message:error.localizedDescription delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
                                             [alrtResult show];
                                             [spinner stopAnimating];
                                         }
                                         else //if(FB_ISSESSIONOPENWITHSTATE(status))
                                         {
                                             NSLog(@"session...%d",FBSession.activeSession.isOpen);
                                             [FBRequestConnection startWithGraphPath:@"me/videos"
                                                                          parameters:params
                                                                          HTTPMethod:@"POST"
                                                                   completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
                                                                       if(!error)
                                                                       {

                                                                           NSLog(@"RESULT: %@", result);
                                                                           UIAlertView *alrtResult=[[UIAlertView alloc]initWithTitle:@"FlipIt" message:@"Upload Complete." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
                                                                           [alrtResult show];

                                                                           [spinner stopAnimating];
                                                                       }
                                                                       else
                                                                       {


                                                                           NSLog(@"ERROR: %@", error.localizedDescription);
                                                                           UIAlertView *alrtResult=[[UIAlertView alloc]initWithTitle:@"FlipIt" message:error.localizedDescription delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
                                                                           [alrtResult show];
                                                                           [spinner stopAnimating];
                                                                       }

                                                                   }];
                                         }
                                     }];
     }

}

I have found lot of question related it, but yet I have not found my solution. 我发现了很多与此有关的问题,但是还没有找到解决方案。 Please help me. 请帮我。

You should match destination format to source video format which is mov. 您应该将目标格式与mov的源视频格式进行匹配。 Also "name" should be changed to "title". 同样,“名称”也应更改为“标题”。

NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                           videoData, @"animation1.mov",
                           @"video/quicktime", @"contentType",
                           self.book.bookName, @"title",
                           @"FlipIt Movie", @"description",
                           nil];

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 该操作无法完成。 (com.facebook.sdk错误5。)在Facebook iOS上发布时 - The operation couldn’t be completed. (com.facebook.sdk error 5.) while posting on facebook ios 该操作无法完成。 (com.facebook.sdk错误5.)FACEBOOK视频上传 - The operation couldn’t be completed. (com.facebook.sdk error 5.) FACEBOOK VIDEO UPLOAD 该操作无法完成。 (com.facebook.sdk错误5.)当试图获取带有ID的详细信息时 - The operation couldn’t be completed. (com.facebook.sdk error 5.) when try to get the details with an ID Facebook FQL-错误:操作无法完成。 (com.facebook.sdk错误5。) - Facebook FQL - Error: The operation couldn’t be completed. (com.facebook.sdk error 5.) 该操作无法完成。 (com.facebook.sdk错误5。) - The operation couldn’t be completed. (com.facebook.sdk error 5.) 登录Facebook时,无法完成操作。(com.facebook.sdk错误2.0)错误。 iOS 6,iPhone3gs - While logging into facebook getting The Operation couldn't be completed.(com.facebook.sdk error 2.0) error. iOS 6,iPhone3gs 该操作无法完成。 (com.facebook.sdk错误2.)ios6 - The operation couldn’t be completed. (com.facebook.sdk error 2.) ios6 Facebook注册:操作无法完成(com.facebook.sdk错误2) - Facebook Registration : The operation couldn't be completed (com.facebook.sdk error 2) FB ios SDK 3.13.1无法完成操作(com.facebook.sdk错误2) - FB ios SDK 3.13.1 The operation couldn't be completed (com.facebook.sdk error 2) iOS的Facebook登录错误:操作无法完成。 (com.facebook.sdk.core错误3。) - Facebook login for iOS error: The operation couldn’t be completed. (com.facebook.sdk.core error 3.)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM