iPhone应用程序如何发布Youtube视频链接使用Facebook图形Api [英] iPhone App how to post Youtube video link using facebook graph Api
本文介绍了iPhone应用程序如何发布Youtube视频链接使用Facebook图形Api的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在iPhone应用程序如何发布Youtube视频链接使用Facebook的图形Api到FaceBook墙贴?
in iPhone App how to post Youtube video link using facebook graph Api to FaceBook Wall post?
推荐答案
:
-(IBAction)postMeFeedButtonPressed:(id)sender {
NSMutableDictionary *variables = [NSMutableDictionary dictionaryWithCapacity:4];
[variables setObject:@"#Your Message" forKey:@"message"];
[variables setObject:@"#http://Your Youtube Link" forKey:@"link"];
[variables setObject:@"#This is the bolded copy next to the image" forKey:@"name"];
[variables setObject:@"#This is the plain text copy next to the image. All work and no play makes Jack a dull boy." forKey:@"description"];
FbGraphResponse *fb_graph_response = [fbGraph doGraphPost:@"me/feed" withPostVars:variables];
NSLog(@"postMeFeedButtonPressed: %@", fb_graph_response.htmlResponse);
//parse our json
SBJSON *parser = [[SBJSON alloc] init];
NSDictionary *facebook_response = [parser objectWithString:fb_graph_response.htmlResponse error:nil];
[parser release];
//let's save the 'id' Facebook gives us so we can delete it if the user presses the 'delete /me/feed button'
self.feedPostId = (NSString *)[facebook_response objectForKey:@"id"];
NSLog(@"feedPostId, %@", feedPostId);
NSLog(@"Now log into Facebook and look at your profile...");
}
这篇关于iPhone应用程序如何发布Youtube视频链接使用Facebook图形Api的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文