I am making a test app through that I want to post video on facebook. I am using latest sdk of facebook. But I am not able to post it on facebook.
My code is as below.
NSDictionary *parameters = [NSDictionary dictionaryWithObject:videoData forKey:@"CareAppDemo.mov"];
FBRequest *request = [FBRequest requestWithGraphPath:@"me/videos" parameters:parameters HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
NSLog(@"result: %@, error: %@", result, error);
}];
Please help me to post video on facebook via my app.
Get the publish permission
Try this
You need to download FacebookSDK first and then add following framework into your project
import them, and write followin code
The video URL videoURL must be an asset URL. You can get a video asset URL e.g. from UIImagePickerController.
or for recording video you can take as follow
for more detail you can use https://developers.facebook.com/docs/sharing/ios
This is the old thread but for all the future readers coming, here is how to do it with the currently latest facebook SDK (
v3.24.0 - September 10th 2015
).IF you want to Upload/Video sharing you must need to pass the Assets Library URL for the original version of the picked item.
If you are using
Then you must need to pass
If you using Document Directory Path then first you need to save video into library. You must need to create url link Assets Library URL.
Successfully tested On FaceBook SDK 3.14.1
Recommendation: 3 properties in .plist file
set FacebookAppID,FacebookDisplayName,
URL types->Item 0->URL Schemes set to facebookappId prefix with
fb
SeeI GOT Error In first time of App runs:
It happens when facebook is being inited. Next time i open my app, it works fine, its always the first time. Tried everything in app, but it seems to be on the Facebook SDK side.
Few causes for seeing
com.facebook.sdk error 5
:publish_actions
a spin.