9

I am trying to share an image with title and description on Facebook but it looks like when I set a Google PLay URL as the ContentUrl then the title and description are not displayed.

This is my code:

if (ShareDialog.canShow(ShareLinkContent.class)) {
    ShareLinkContent linkContent = new ShareLinkContent.Builder()
      .setContentTitle("I want this car")
      .setContentUrl(Uri.parse("http://www.producthunt.com"))
      .setImageUrl(Uri.parse("http://www.topgear.com/uk/assets/cms/50b95ad3-7884-4b3d-ba3c-68dbeff8b737/Large%20Image%20(optional).jpg"))
      .build();
    shareDialog.show(linkContent);
}

The Result:

enter image description here

But when I set a Google Play URL as ContentURL:

if (ShareDialog.canShow(ShareLinkContent.class)) {
      ShareLinkContent linkContent = new ShareLinkContent.Builder()
         .setContentTitle("I want this car")
         .setContentDescription("This description should be displayed below the image but somehow it depends on the link.")
         .setContentUrl(Uri.parse("https://play.google.com/store/apps/details?id=com.evernote"))
         .setImageUrl(Uri.parse("http://www.topgear.com/uk/assets/cms/50b95ad3-7884-4b3d-ba3c-68dbeff8b737/Large%20Image%20(optional).jpg"))
         .build();
   shareDialog.show(linkContent);

}

The Result:

enter image description here

I tried this with other general and google play links and I always got the same result. What's wrong?

EDIT

I submitted this question to the Facebook team and even though they admitted that this is a bug I was told that they won't fix it any time soon. https://developers.facebook.com/bugs/1435972263375939

erdomester
  • 11,789
  • 32
  • 132
  • 234
  • We grab the title, description and image from the url you share – WizKid May 14 '15 at 22:41
  • Still no explanation to why it's not working with Google Play links. – erdomester May 15 '15 at 16:01
  • I noticed this as well on v4 SDK. title and content work for all other URLs, but only this one is being filtered this way – sandalone Jun 26 '15 at 15:42
  • @WizKid He may not described it well. If I set any regular URL (like from some web page), the content title and desctiption is displayed properly. But if we set URL such as `https://play.google.com/store/apps/details?id=com.xxx.yyy`, the share will pull App Name from the Play Store as the title and description will be empty. The same happens when either `http` ot `https`. I tested by switching the URLs, and each time with any app on Google Play, this error happens. – sandalone Jun 26 '15 at 15:50
  • http://stackoverflow.com/questions/29081584/facebook-sdk-and-sharing-a-play-store-app-link-with-sharedialog-issue – sandalone Jun 26 '15 at 15:53
  • @sandalone: Correct. We use the content from the URL. – WizKid Jun 26 '15 at 15:59
  • @WizKid Do you mean when we point to Google Play? As if I point to a certain web page, I can set my own Title and Description and Image. Funny thing is that pointing to Google Play will only remove title and description, while passed image will be displayed (not image from the Google Play link) – sandalone Jun 26 '15 at 16:01
  • possible duplicate of [Android - Facebook share content gets overwritten](http://stackoverflow.com/questions/30743698/android-facebook-share-content-gets-overwritten) – Peter O. Jul 02 '15 at 16:35
  • @erdomester have u tried with the resolved IP for play.google.com?? 216.58.211.238 – eduyayo Aug 11 '15 at 08:54
  • or, maybe, something like http://www.kickme.to/ – eduyayo Aug 11 '15 at 08:57
  • I can confirm this is still not fixed! – Muhammad Babar Jul 27 '16 at 09:27
  • The solution is to use a external webpage address or you can also use facebook free app link hosting https://developers.facebook.com/docs/applinks. Then you have to use deep linking as describe here https://developer.android.com/training/app-indexing/deep-linking.html – Muhammad Babar Aug 03 '16 at 05:34

1 Answers1

0

I found 1 partial solution that may work depending on your requirements. Replace "https://play.google.com/store/apps/details?id=com.xxx.yyy" by a redirect address. I used one created in my Facebook app configuration "https://fb.me/xxxxxxxxxxxxxxx". The result of the share is working correctly with the custom contentDescription. The remaining issue is that the preview is not working in the "share to Facebook" popup ("A preview will be added after you post this to Facebook"). If you don't worry about your users seeing that preview this solution may work for you.

chris
  • 321
  • 3
  • 6