4

I'm using the cordova Facebook plugin (https://github.com/jeduan/cordova-plugin-facebook4) in a Meteor mobile app on Android.

I can successfully use the Share Dialog to share a photo with a link (as in the plugin example here: https://github.com/jeduan/cordova-plugin-facebook4#show-a-dialog). I.e...

{
  method: "share",
  href: "http://example.com",
  caption: "Such caption, very feed.",
  description: "Much description",
  picture: 'http://example.com/image.png'
}

However, if I attempt to share a photo-only (i.e. with no website link)...

facebookConnectPlugin.showDialog({
  method: "share",
  picture:'https://www.google.co.jp/logos/doodles/2014/doodle-4-google-2014-japan-winner-5109465267306496.2-hp.png',
  name:'Test Post',
  message:'First photo post',
  caption: 'Testing using phonegap plugin',
  description: 'Posting photo using phonegap facebook plugin'
}, function (response) {
  console.log(response)
}, function (response) {
  console.log(response)
});

....the Share Dialog opens, but is empty.

This is exactly as per the final example given on the plugin's github (https://github.com/jeduan/cordova-plugin-facebook4#publish-a-photo) so I assume it's a valid use-case.

Any ideas?

Vertexwahn
  • 7,709
  • 6
  • 64
  • 90
Neil
  • 1,821
  • 4
  • 14
  • 27

4 Answers4

1

Refer this:

  1. https://github.com/jeduan/cordova-plugin-facebook4/issues/36
  2. Facebook share content only shares URL in iOS 9
  3. https://github.com/jeduan/cordova-plugin-facebook4/issues/221

and if it still not solved your problem then there is official open issue with this plugin you will need to change the plugin.

Community
  • 1
  • 1
Akshay Tilekar
  • 1,910
  • 2
  • 12
  • 22
0

You need to adjust the method to be "feed" instead of "share" if no link is provided.

Change:

 method: "share",

To:

 method: "feed",
Colin Smillie
  • 431
  • 3
  • 7
  • 1
    Result is the same whether the method is _share_ or _feed_ - dialog opens, but is completely empty. – Neil Jan 19 '17 at 09:49
0

I had the same issues and finally got it resolved! How? I just did this:

method: "share",
href: 'url_of_image_or_photo_to_share'

Even after doing it this way, the share dialog was showing like a link or small icon! So I went ahead and hit the Post but and saw it like I would expect on Facebook.

Give it a trial!

Aweda
  • 323
  • 1
  • 4
  • 15
0

1. untrusted ssl cert for https image url

If the certificate isn't trusted by facebook, it won't preview the image. See https://rameerez.com/facebook-sharing-not-scraping-url-correctly-with-https-links/

2. image has not been cached by facebook

https://developers.facebook.com/docs/sharing/best-practices/

Pre-caching images

When content is shared for the first time, the Facebook crawler will scrape and cache the metadata from the URL shared. The crawler has to see an image at least once before it can be rendered. This means that the first person who shares a piece of content won't see a rendered image:

enter image description here

To verify whether this is the problem, use the facebook Sharing Debugger:

https://developers.facebook.com/tools/debug/

Community
  • 1
  • 1
Lightbeard
  • 4,011
  • 10
  • 49
  • 59