将照片发布到Facebook
|
我正在努力寻找一些示例代码,以便在Facebook上发布。下面是我发现的代码。但是,我可以知道如何修改它以便我发布图片而不是文字吗?
FBStreamDialog* dialog = [[[FBStreamDialog alloc] init] autorelease];
dialog.userMessagePrompt = @\"Enter your message:\";
dialog.attachment = [NSString stringWithFormat:@\"{\\\"name\\\":\\\"%@ got straight A\'s!\\\",\\\"href\\\":\\\"http://www.raywenderlich.com/\\\",\\\"caption\\\":\\\"%@ must have gotten real lucky this time!\\\",\\\"description\\\":\\\"\\\",\\\"media\\\":[{\\\"type\\\":\\\"image\\\",\\\"src\\\":\\\"http://www.raywenderlich.com/wp-content/themes/raywenderlich/images/logo.png\\\",\\\"href\\\":\\\"http://www.raywenderlich.com/\\\"}]}\", _facebookName, _facebookName];
dialog.actionLinks = @\"[{\\\"text\\\":\\\"Get MyGrades!\\\",\\\"href\\\":\\\"http://www.raywenderlich.com/\\\"}]\";
[dialog show];
我尝试发布的图像也是重叠图像。这意味着它上没有文件名。声明为imageall的属性是下面的代码。
CGRect subviewFrame3 = [self.comment.superview convertRect:self.comment.frame toView:self.imageall]; [self.imageall addSubview:self.comment]; self.comment.frame = subviewFrame3;
UIGraphicsBeginImageContext(self.imageall.frame.size);
[self.imageall.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsGetCurrentContext();
self.outputView.image = image;
非常感谢。
没有找到相关结果
已邀请:
2 个回复
旅牢斯讲
辟官陡板休