- Home /
Facebook Share missing title and description
Hello Unity Community!
I'm trying to create a facebook share option for my android game. Here's some code:
public void ShareToFacebook(){
FB.ShareLink(
new Uri("la la la url here"),
"My High Score",
"Think you can beat my "+_score.ToString()+" score?",
callback: ShareCallback
);
}
private void ShareCallback (IShareResult result) {
if (result.Cancelled || !String.IsNullOrEmpty(result.Error)) {
Debug.Log("ShareLink Error: "+result.Error);
} else if (!String.IsNullOrEmpty(result.PostId)) {
// Print post identifier of the shared content
Debug.Log(result.PostId);
} else {
// Share succeeded without postID
Debug.Log("ShareLink success!");
}
}
However, the share that shows up contains only the link, no title or description show up. Any ideas why? Note that I only did the FbInit, and not the login as well. They said it's not required.
Thanks for your time!
Are you sharing a google play or ios app store link? Apparently that's the problem, at least for me. Sharing a google play or ios app store link will cause facebook to automatically ignore title and description, even though it's not mentioned anywhere in the documentation for the unity sdk. I've tried using the older method called FB.FeedShare(). Sadly, this one ignores title, description and caption as well. The only solution here is to get your app on the facebook app center. But as a fair warning, you should know that it involves implementing FB login, having a privacy policy for your app and many other things.
how did you even get that to compile? im stuck with the error "the type or namespace name 'uri' could not be found'"
also !String.IsNullOrEmpty is also giving errors
Answer by Salazar · Oct 22, 2015 at 08:28 PM
Hello Ashky,
Yes they didnt mention it in sdk. If you take a closer look to their tutorial game "Friend Smasher", they couldnt share how many friends smashed! (https://developers.facebook.com/docs/games/unity/unity-tutorial)
Check the Brag and NewsFeed part of tutorial.
And yes no appstore links can be used and also you can not use facebook app center link too. I tried it too.
Here is the facebook support answer for it ; "The URL, you are trying to scrape / modify the title & description for is a facebook.com URL: https://www.facebook.com/games/crowalpha/. you cannot change these details for facebook.com URLs."
Here is my bug report ticket : https://developers.facebook.com/bugs/438799922973430
I used my games blog post link.
Hope it helps for your situation until you make your own plugin =)
Regards,
Hey @Salazar I have implemented Facebook integration in the unity sample game and I can share on Facebook using fb.sharelink and fb.feedshare successfully. But now I created a new Facebook application and added android platform in it also. but now when I integrated this new Facebook in real game project it shares but tile & description is missing and ins$$anonymous$$d it setting title from provided link as content URL. I want title and description to be dynamic and it is successfully going on sample project. but the same function and same methods trying on this newly created Facebook application is not allowing me to achieve sharing.
I have checked all settings of both of these apps and they are same in developers.facebook.com
Can you help me on this ?