作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
尝试通过 FBSDKShareLinkContent 分享本 map 片,但没有成功。
我的示例代码是:
let content: FBSDKShareLinkContent = FBSDKShareLinkContent()
content.contentTitle = "test share"
content.contentURL = NSURL(string: "http://example.com")
let path = NSBundle.mainBundle().pathForResource("testImage", ofType: "png")
content.imageURL = NSURL(string: path!)
let shareDialog = FBSDKShareDialog()
shareDialog.mode = FBSDKShareDialogMode.Native
shareDialog.shareContent = content
shareDialog.fromViewController = self
shareDialog.show()
最佳答案
要共享图像,您需要使用 FBSDKSharePhotoContent
。在 Objective C 中检查以下代码
- (void)imagePickerController:(UIImagePickerController *)picker
didFinishPickingMediaWithInfo:(NSDictionary *)info
{
UIImage *image = info[UIImagePickerControllerOriginalImage];
FBSDKSharePhoto *photo = [[FBSDKSharePhoto alloc] init];
photo.image = image;
photo.userGenerated = YES;
FBSDKSharePhotoContent *content = [[FBSDKSharePhotoContent alloc] init];
content.photos = @[photo];
...
}
关于ios - FBSDKShareContent 分享本 map 片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32968264/
尝试通过 FBSDKShareLinkContent 分享本 map 片,但没有成功。 我的示例代码是: let content: FBSDKShareLinkContent = FBSDKShar
我是一名优秀的程序员,十分优秀!