你可以这样做:
NSURL *url = [NSURL URLWithString:@"https://graph.facebook.com/me/feed"];
ASIFormDataRequest *newRequest = [ASIFormDataRequest requestWithURL:url];
[newRequest setPostValue:message forKey:@"message"];
[newRequest setPostValue:accessToken forKey:@"access_token"];
[newRequest setPostValue:imageURL forKey:@"picture"];
[newRequest setPostValue:attachmentName forKey:@"name"];
[newRequest setPostValue:attachmentCaption forKey:@"caption"];
[newRequest setPostValue:attachmentDescription forKey:@"description"];
[newRequest setPostValue:href forKey:@"link"];
//[newRequest setPostValue:@"http://www.foo.com/bar.swf" forKey:@"source"];
[newRequest setDidFinishSelector:@selector(postToWallFinished:)];
[newRequest setDelegate:self];
[newRequest startAsynchronous];
或者您可以在共享资源的元标记中设置参数:
NSURL *url = [NSURL URLWithString:@"https://graph.facebook.com/me/feed"];
ASIFormDataRequest *newRequest = [ASIFormDataRequest requestWithURL:url];
[newRequest setPostValue:message forKey:@"message"];
[newRequest setPostValue:href forKey:@"link"];
[newRequest setPostValue:accessToken forKey:@"access_token"];
[newRequest setDidFinishSelector:@selector(postToWallFinished:)];
[newRequest setDelegate:self];
[newRequest startAsynchronous];
和:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" xmlns:og="http://ogp.me/ns#">
<head>
<title>Foobar</title>
<!-- Facebook meta tags -->
<meta property="og:title" content="meta title"/>
<meta property="og:url" content="http://www.foo.com"/>
<meta property="og:image" content="http://www.foo.com/bar.png"/>
<meta property="og:site_name" content="meta site name"/>
<meta property="fb:admins" content="123"/>
<meta property="og:description" content="meta description"/>
<meta property="og:type" content="website"/>
<!-- <meta property="og:video" content="http://www.foo.com/bar.swf"/> -->
<!-- <meta property="og:video:width" content="1200"/> -->
<!-- <meta property="og:video:height" content="800"/> -->
...