Skip to content

Instantly share code, notes, and snippets.

@SongJiaqiang
Created October 13, 2016 11:57
Show Gist options
  • Save SongJiaqiang/f92d78e5ea1b831c376f00931b481fd1 to your computer and use it in GitHub Desktop.
Save SongJiaqiang/f92d78e5ea1b831c376f00931b481fd1 to your computer and use it in GitHub Desktop.
// Get the publish permission
- (void)getPublishPermission {
NSArray* permissions = [[NSArray alloc] initWithObjects:
@"publish_stream", nil];
[facebook authorize:permissions delegate:self];
[permissions release];
}
- (void)fbDidLogin {
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"sample" ofType:@"mov"];
NSData *videoData = [NSData dataWithContentsOfFile:filePath];
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
videoData, @"video.mov",
@"video/quicktime", @"contentType",
@"Video Test Title", @"title",
@"Video Test Description", @"description",
nil];
[facebook requestWithGraphPath:@"me/videos"
andParams:params
andHttpMethod:@"POST"
andDelegate:self];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment