iphone - ShareKit - 将链接图像发布到 facebook 墙上

标签 iphone objective-c ios facebook sharekit

(这个真的和这个问题一样,只是给出的答案不相关

add image and description on facebook with sharekit )

如何使用 ShareKit 发送图像链接,以便在共享时显示如下:

enter image description here

或者,我能否将 FB 应用程序设置为在发布内容时始终显示大图标?

最佳答案

(回答我的问题)

我更改了文件 SHKfacebook.m,将 dialog.attachment 行更改为:

dialog.attachment = [NSString stringWithFormat:@"{\"name\":\"%@\",\"href\"
:\"%@\",\"media\":[{\"type\":\"image\",\"src\":\"http://example.com/example.png\"
,\"href\": \"http://example.com/\"}]} ",item.title == nil ? SHKEncodeURL(item.URL) 
SHKEncode(item.title),SHKEncodeURL(item.URL)];

(粘贴后一行)

你可以看到有一个图片 url - http://example.com/example.png - 这应该是大约 76 X 90 像素,和一个链接 url - http://example.com/

您可能还需要明确设置共享类型。我注意到在 3G/3GS iPhone 上它不起作用,除非你这样做:

item.shareType = SHKShareTypeURL;
[SHKFacebook shareItem:item];

关于iphone - ShareKit - 将链接图像发布到 facebook 墙上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7122414/

相关文章:

javascript - UIWebView iOS document.getElementByID 不起作用

ios - 在iPhone4上使用OpenGL ES加载大纹理时出现glError 0x0501

iphone - 在 iPhone 编程中使用标签——有人能解释一下吗?

ios - 如何根据不同的形状拼贴图像

ios - Swift 3 多个 AVAudioPlayer

ios - 替换 GoogleService-Info.plist 是否足以让其他人的应用程序使用我的包标识符?

iphone - 获取响应映射对象的Json字符串 restkit v0.2.20

ios - Spritekit - 动态添加 child 会降低性能

iOS - 如何以编程方式在安全区域内创建 View

ios - 将 AnyObject 转换为 Int