Как поделиться видео в Facebook SDK?

Я написал код, как показано ниже, где файл существует в ресурсах. Это не нуль.

Я успешно добавляю изображения, но застрял на видео.

-(void)uploadVideo {

    NSLog(@"UPload Videio ");

    NSString *filePath = [[NSBundle mainBundle] pathForResource:@"abc" ofType:@"mp4"];

    NSError *error = nil;


    NSData *data = [NSData dataWithContentsOfFile:filePath options:NSDataReadingUncached error:&error];

    if(data == nil && error!=nil) {
        //Print error description

        NSLog(@"error is %@", [error description]);
    }

    NSLog(@"data is %@", data);

    NSDictionary *parameters = [NSDictionary dictionaryWithObject:data forKey:@"sample.mov"];

    if (FBSession.activeSession.isOpen) {


        [FBRequestConnection startWithGraphPath:@"me/videos"
                                     parameters:parameters
                                     HTTPMethod:@"POST"
                              completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
                                //  [FBRequestConnection setVideoMode:NO];

                                  if(!error) {
                                      NSLog(@"OK: %@", result);
                                  } else
                                      NSLog(@"Error: %@", error.localizedDescription);

                              }];

    } else {

        // We don't have an active session in this app, so lets open a new
        // facebook session with the appropriate permissions!

        // Firstly, construct a permission array.
        // you can find more "permissions strings" at http://developers.facebook.com/docs/authentication/permissions/
        // In this example, we will just request a publish_stream which is required to publish status or photos.

        NSArray *permissions = [[NSArray alloc] initWithObjects:
                                @"publish_stream",
                                nil];
        //[self controlStatusUsable:NO];
        // OPEN Session!
        [FBSession openActiveSessionWithPermissions:permissions
                                       allowLoginUI:YES
                                  completionHandler:^(FBSession *session,
                                                      FBSessionState status,
                                                      NSError *error) {
                                      // if login fails for any reason, we alert
                                      if (error) {

                                          // show error to user.

                                      } else if (FB_ISSESSIONOPENWITHSTATE(status)) {

                                          // no error, so we proceed with requesting user details of current facebook session.


                                          [FBRequestConnection startWithGraphPath:@"me/videos"
                                                                       parameters:parameters
                                                                       HTTPMethod:@"POST"
                                                                completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
                                                                    //  [FBRequestConnection setVideoMode:NO];

                                                                    if(!error) {
                                                                        NSLog(@"Result: %@", result);
                                                                    } else
                                                                        NSLog(@"ERROR: %@", error.localizedDescription);

                                                                }];





                                          //[self promptUserWithAccountNameForUploadPhoto];
                                      }
                                      // [self controlStatusUsable:YES];
                                  }];
    }

}

В ответ я получаю ошибку как

The operation couldn’t be completed. (com.facebook.sdk error 5.)

Как загрузить видео на Facebook, используя Facebook iOS SDK?

Спасибо

Ответы на вопрос(4)

Ваш ответ на вопрос