ShareKit - 张贴链接图像到Facebook墙 [英] ShareKit - posting linked image to facebook wall
问题描述
(这与这个问题是一样的,但是给出的答案是不相关的。
您可能还需要显式设置共享类型。我注意到3G / 3GS iPhone,除非你这样做,否则它不起作用:
item.shareType = SHKShareTypeURL;
[SHKFacebook shareItem:item];
( this is really the same as this question, but the answer given was not relevant
add image and description on facebook with sharekit )
How do I send a link to an image with ShareKit, so that when shared, it appears like so:
Or, alternatively, can I set the FB app to always show the big icon when something is posted?
(answering my question)
I changed the file SHKfacebook.m changing the dialog.attachment line to read:
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)];
(make it one line after you paste in)
You can see there is an image url - http://example.com/example.png - which should be about 76 X 90px, and a link url - http://example.com/
You may also need to explicitly set the sharetype. I've noticed on 3G/3GS iPhones then it doesn't work unless you do this:
item.shareType = SHKShareTypeURL;
[SHKFacebook shareItem:item];
这篇关于ShareKit - 张贴链接图像到Facebook墙的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!