Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Share video on Facebook using ASIFormDataRequest

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 1.06k
    Comment on it

    In facebook graph API "https://graph.facebook.com/" url is used for all APIs. But to post a video on facebook an other API url is provided. To post video on facebook you must use "https://graph-video.facebook.com/me/videos" API.

    Below is the code for sharing video on facebook using ASIFormDataRequest.

    -(void)shareVideoOnFacebook:(NSData*)data WithTitle:(NSString*)title{
         NSURL *url = [NSURL URLWithString:@"https://graph-video.facebook.com/me/videos"];
        ASIFormDataRequest *newRequest = [ASIFormDataRequest requestWithURL:url];
        [newRequest setPostValue:title forKey:@"title"];
        [newRequest addData:data withFileName:@"videoOne.mov" andContentType:@"multipart/form-data" forKey:@"file"];
        [newRequest setPostValue:yourAccessToken forKey:@"access_token"];
        [newRequest setRequestMethod:@"POST"];
        [newRequest setDidFinishSelector:@selector(postVideoOnFacebookFinished:)];
        [newRequest setDidFailSelector:@selector(postVideoOnFacebookfailed:)];
        [newRequest setDelegate:self];
        [newRequest startAsynchronous];
    }
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: