【发布时间】:2014-04-01 00:48:40
【问题描述】:
我可以使用以下代码与 facebook 分享文字、图片和网址。
_lblTitle.text=@"Joe just ran 3.10 miles on the Niagara Falls 5k in 24.53 with http://www.outsideinteractive.com";
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
_lblTitle.text, @"name",
data, @"picture",
nil];
// Make the request
[FBRequestConnection startWithGraphPath:@"/me/photos"
parameters:params
HTTPMethod:@"POST"
completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
if (!error) {
// Link posted successfully to Facebook
NSLog([NSString stringWithFormat:@"result: %@", result]);
} else {
// An error occurred, we need to handle the error
// See: https://developers.facebook.com/docs/ios/errors
NSLog([NSString stringWithFormat:@"%@", error.description]);
}
}];
但现在我想分享超链接(有链接的文本)。
示例: Joe 刚刚在 24.53 的 Virtual Niagara Falls 5k Course 上跑了 3.10 英里,Outside Interactiive。
目前我可以这样分享:
Joe 刚刚在 24.53 在 Niagara Falls 5k 上跑了 3.10 英里,http://www.outsideinteractive.com
注意:我也在分享当前功能的图片,我想继续。
期望的结果:
【问题讨论】:
-
你是怎么解决这个问题的。请分享解决您问题的代码或链接。我必须做同样的任务。但找不到有用的链接。我尝试使用 html 字符串但未能成功。
标签: ios iphone objective-c facebook facebook-graph-api