Facebook Cordova plugin - sharing a photo (with no link) results in empty Share Dialog

304
January 19, 2017, at 06:27 AM

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?

Answer 1

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

Change:

 method: "share",

To:

 method: "feed",
READ ALSO
Android sequential touching buttons

Android sequential touching buttons

As I am new in Android programming, I need some help to implement the following scenario:

237
GoogleApiClient does not connect

GoogleApiClient does not connect

GoogleApiClient does not get connected i have seen some of similar questions but am not able to find a solution here is my code

355
Android move file to External Device with press of Button

Android move file to External Device with press of Button

I need to make a button so that it moves a specific file to the External DriveI have set the manifest so it allows to write to External Storage but I can not find the code to write a specific file to write to the External Storage

230