facebookConnectPlugin.showDialog is not showing image on share dialog

2.1k Views Asked by At

I have recently upgraded a Cordova app from V2.9 to V3.5, I am trying to share a link to facebook in a cordova app but Dialog is not showing image in the share dialog.

Plugin used : https://github.com/Wizcorp/phonegap-facebook-plugin

Code:

facebookConnectPlugin.showDialog({
  method: 'feed',
  link: 'http://example.com'
}, function(response){});

og metatags at example.com

<meta property="og:image" content="path to logo.jpg" />
<meta property="og:url" content="http://example2.com" />

there are no og metatags at example2.com

Problem

facebookConnectPlugin.showDialog is not showing image in the dialog since in between last month.

Findings

Dialog is getting title and description from the example2.com and as there is no og:image tag there, dialog is not showing any picture.

Plugin is making call to v2.2 API of the FB graph API while our FB App in facebook is V1.0

Old cordova App is making call to V1.0 API of the FB Graph and it is also not showing the picture now.

There is a or:url in a metatag of the example.com which points to example2.com and I have no access to change the og:url.

Question

What is causing the problem, is it FB Graph API update or og:url and if it is og:url, then how was it working before?

2

There are 2 best solutions below

0
On

I can't see where you use the PhoneGap plugin specific methods:

IMHO, the code should be

facebookConnectPlugin.showDialog({
    method: "feed",
    link: "http://example.com",
    caption: "Such caption, very feed."
}, function(success) { }, function(error) { });
0
On

Try loading the image from url First ensure that the page example.com has the image on the page the do this your code should work Note that where the page has more than one image the user may be prompted to select one.

Good luck

facebookConnectPlugin.showDialog({
 method: 'feed',
 link: 'http://example.com',
}, function(response){});

You can also post the same issues here https://github.com/Wizcorp/phonegap-facebook-plugin/issues

and someone will help you out ASAP