Hello, I’m trying to post to facebook, and all goes great. But when I use the FB.FeedShare and try to share a picture, even if I use FB’s ‘debugger’ to get the image first and cache it, even if I already share it a couple of times, it’s not showing my picture. Anyone ever get this issue? I’m also not getting the captions or descriptions… Just the picture from the link.
FB.FeedShare(
string.Empty, //toId
new System.Uri(""), //link
"BeetleJuice: Bad as Can", //linkName
"", //linkCaption
"Get BeetleJuice: Bad as Can for iOS and Android!", //linkDescription
new System.Uri("http://www.flightsystemsllc.com/beetlejuicefb.png"), //picture
string.Empty, //mediaSource
ShareCallback //callback
);
So, welcome to the wonderful world of Facebook where they change things and forget to really inform us or they don’t update their Unity SDK to reflect the changes (or their examples)
Basically, you can no longer use FeedShare or ShareLink the way it was intended. Instead, I had to create an html file with meta tags that I pass in as the first parameter in the ShareLink call. This meta html file contains all the information that we use to pass in in place of the parameters (note the rest of the sharelink parameters will be null or “”).
It’s a pain to deal with. It took a bit but we got the image working and then had to add some redirect code to the html file so that if a user clicks on the shared image it still takes them to the game and not to the html file link. While this may not be how to do it, it’s the only way I got it working right.
Hi Brathnann, can you please tell how to do this part?
"then had to add some redirect code to the html file so that if a user clicks on the shared image it still takes them to the game and not to the html file link. "
since the img its referenced on a meta tag on the head tag, it does not have an “a” tag, right? so how did you set the img to be a button redirecting to the link you’ve wanted?
Unfortunately, I didn’t design the redirect on our website itself. In the html file with the meta tags (which are in the head part of the html) I just added
The website link is a link to our gamewebsite which then handles which platform they are on and redirects to the clicker to FB or one of the mobile stores. But our web person created that.
I can’t say this is the best solution though. Just what I did to address the issue.
Hi again, thanks a lot for your quick reply.
Well i do have a gamewebsite, i’ve created a different html for these sharing pourposes, in which i have added the meta tags on the head part, and now the script you just wrote on the body part (writing my gamewebsite link where you’ve indicated)…still when i click the image it send me to the html with the meta tags, not the gamewebsite .
I ask for the img size because im getting blurry results, it may be caused by the web images retina display issue, but no idea how to fix it in these particular case.
The feedshare call takes a link, this is where you pass in the link to the html file. This html file contains your metatags and the code I shared above for the body tags. Then when a user clicks the link, it goes to that html file which then redirects them to the link that you assign in the body tags.
Our share images are 1200x627 which I think was one of the sizes facebook recommends.
Oh one last question, as the info that appear on the share dialog is submited direcly on the html file, is there a way to use data stored on my c# variables? for example, scores?