iPhone Facebook Video Upload

I’ve got a video upload branch in my fork of the Facebook SDK on GitHub. I did not touch it for several weeks, but it used to work fine (only it requires the old-style authentication, see this branch). There are some comments in the FBVideoUpload class header, but the interface is pretty much self-explanatory. There’s also some helpful discussion under my pull request – especially the thing about SSL certificates on the api-video cluster that could make the whole issue easier, but I did not review the code yet.

[Rant: It’s a pity that the Facebook SDK for iOS does not exactly thrive on GitHub. There are many pull requests, but the official developers never seem to merge anything, not even trivial typo fixes in the documentation. Most of the time the pull requests simply sit there until rejected.]

And yes, did I mention that the video upload code is a messy hack? The video upload code is a messy hack. It parses some auth tokens and it could break anytime soon, but it was the only way I could make it work back then.


Update: The video upload branch is no more, you can now easily upload video using the official SDK:

NSData *videoData = [NSData dataWithContentsOfURL:movieURL];
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
    …, @"title", 
    …, @"description", 
    …, @"file",
    videoData, @"clip.mov",
    nil];
[facebook requestWithGraphPath:@"me/videos" andParams:params andHttpMethod:@"POST" andDelegate:self];

This is “the right way to do it”™, the previous solution was just a temporary hack.

Leave a Comment