Viraj
Viraj

Reputation: 209

iOS Video upload to Facebook - error but success

This code perfectly worked for me few days ago. But now I'm getting

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

error but the video is successfully uploaded. Has anyone face this issues before ? What might be the issue here ?

My code is

NSData *videoData = [NSData dataWithContentsOfFile:video_file_location];
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                               videoData, _videoFileName],
                               @"video/quicktime", @"contentType",
                               @"iOS app title", @"title",
                               @"my description", @"description",
                               nil];

[FBRequestConnection
 startWithGraphPath:@"me/videos"
 parameters:params
 HTTPMethod:@"POST"
 completionHandler:^(FBRequestConnection *connection,
                     id result,
                     NSError *error) {
     NSLog(@"FB error - %@", [error localizedDescription]);

 }];

And I get permission with

[FBSession openActiveSessionWithPublishPermissions:[[NSArray alloc] initWithObjects:@"publish_stream", nil]
                                       defaultAudience:FBSessionDefaultAudienceFriends
                                          allowLoginUI:YES
                                     completionHandler:^(FBSession *session,
                                                         FBSessionState state, NSError *error) {
                                         [self sessionStateChanged:session state:state error:error];
                                     }];

Any feedback is highly appreciated.

Upvotes: 0

Views: 138

Answers (1)

Related Questions