Error posting video to Facebook using SDK for iOS

后端 未结 3 534
猫巷女王i
猫巷女王i 2021-02-15 10:27

I have an app that posts native (MOV files) video to Facebook using the Facebook SDK for iOS. It worked without problems till a few weeks ago where it started failing with the f

3条回答
  •  走了就别回头了
    2021-02-15 11:17

    I don't use key contentType int params. It works well with Facebook SDK 3.10 (latest)

    NSData *videoData = [NSData dataWithContentsOfFile:filePath];    
    NSString* videoName = [filePath lastPathComponent];
    NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
    [params setObject:caption forKey:@"description"];
    [params setObject:videoData forKey:videoName];
    
    FBRequestConnection *requestConnection = [FBRequestConnection startWithGraphPath:@"me/videos"
                                 parameters:params
                                 HTTPMethod:@"POST"
                          completionHandler:^(FBRequestConnection *connection, id result, NSError *error)
    {
    
    }];
    

提交回复
热议问题