Following much research as I could do, I have tried to post facebook video using the following:
NSDictionary *params = [ NSDictionary dictionaryWithObjectsAndKeys:
filmData, @"video.mov", // @"source",
@"video/m4v", @"contentType",
@"Figure It!", @"title",
@"Figure It! Film", @"description",
nil
];
/* make the API call */
NSString* graphPath = [ NSString stringWithFormat:@"%@/me/videos", facebook_video_base_url ];
FBRequest *request = [ FBRequest requestWithGraphPath:graphPath
parameters:params
HTTPMethod:@"POST" ];
[ request startWithCompletionHandler:^(
FBRequestConnection *connection,
id result,
NSError *error
)
These are my observations:
- If I post to https://graph-video.facebook.com/me/videos, it always returns me the generic answer which has the id for the root object /me/videos. The id for this is always 10150481253673034.
- If post to me/videos then I get the error "(#352) Sorry, the video file you selected is in a format that we don't support."
- I have used description instead of message, and I also used title.
- I have used @"video.mov" instead of @"source",
- I have used @"contentType", though some answers have it as @"content-Type". I tried both options.
- Then some answers have @"ContentType" as @"multipart/formdata" and others have it as @"video/quicktime". I have tried both with no difference in result.
I read the documentation in the Facebook header file, and it says that if you supply NSData as parameter it is sent as HTTP attachment, so it will not be sent as multipart data. And if I do the assembly of the HTTP body myself there is no API to make a FBRequest with an pre assembled HTTP body.
Nothing I do gives me back an id for a newly uploaded video. If anyone can help, that would be great. Thanks,