Skip to content
This repository has been archived by the owner on Oct 24, 2022. It is now read-only.

Share Dialog empty #36

Closed
BenitoP opened this issue Sep 9, 2015 · 19 comments
Closed

Share Dialog empty #36

BenitoP opened this issue Sep 9, 2015 · 19 comments

Comments

@BenitoP
Copy link

BenitoP commented Sep 9, 2015

So I am using the following code as per the readme but the dialog is completely empty with no image or any of the text. I did complete the share and entered my own text, which worked, but pointless. The sharing works fine when the native Facebook app is not installed on the device.

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)
  }
);

Cordova version 5.2.0
Cordova Android version 4.1.1

Any help would be greatly appreciated.

@jeduan
Copy link
Owner

jeduan commented Sep 9, 2015 via email

@BenitoP
Copy link
Author

BenitoP commented Sep 10, 2015

Changed it from "share" to "feed". Now I am getting this in Logcat: "The publish_actions permissions are missing, the share will fail unless this app was authorized to publish in another installation." and only get an instant "Ok" response

@taejaehan
Copy link

Change the 'href' as 'link' in buildContent function in the file ConnectPlugin.java.
it works for me :)

@santimaya
Copy link

Same issue here, i've changed from share to feed and nothing gets shared. Using Cordova iOS 3.9.2.

facebookConnectPlugin.showDialog({
    method: "feed",
    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)
  }
);

Any help would be appreciated.

@santimaya
Copy link

It works on simulator but not on device

captura de pantalla 2015-11-03 a las 0 58 27

![img_2442](https://cloud.githubusercontent.com/assets/14928131/10901021/55f1de0a-81c6-11e5-99a1-a19d908d9812.png)

@BenitoP
Copy link
Author

BenitoP commented Nov 3, 2015

The fix for me was simply to upgrade my Cordova and Android to the latest versions ( Cordova - 5.2.0 & Android 3.6.4). After upgrading there were no more issues with the plugin.

@santimaya
Copy link

I'm Running:

Cordova 5.3.3
Cordova iOS 3.9.2

Still not working.

@auching
Copy link

auching commented Nov 12, 2015

it's still not working, after two months

@renanvs
Copy link

renanvs commented Dec 18, 2015

Still empty on device, simulator works fine

@mtshare
Copy link

mtshare commented Feb 12, 2016

+1

@edriang
Copy link

edriang commented Feb 15, 2016

I could correct the behaviour by modifying FacebookConnectPlugin.m, adding after line 270 the following:

dialog.mode = FBSDKShareDialogModeNative; // if you don't set this before canShow call, canShow would always return YES
        if (![dialog canShow]) {
            // fallback presentation when there is no FB app
            dialog.mode = FBSDKShareDialogModeFeedBrowser;
        }

I followed this solution from SO: http://stackoverflow.com/a/33152056/1738363

It's now sharing description and picture as expected

@jeduan
Copy link
Owner

jeduan commented Feb 15, 2016

@edriang can you send a PR?

@hirbod
Copy link
Collaborator

hirbod commented Apr 23, 2016

@edriang could you please send a PR using the current codebase? Thanks!

@Heshyo
Copy link

Heshyo commented May 17, 2016

Like @edriang said, you can force the plugin to not use the app and use the browser instead when sharing, but it sounds more like a hack than a real solution. Also it looks like there's been a new commit since his suggested code: 0078d09

As a temporary fix, I always do dialog.mode = FBSDKShareDialogModeFeedBrowser; no matter what.

@allurco
Copy link

allurco commented May 17, 2016

Having issues as well with the shareDialog on Android:

Error in Success callbackId: FacebookConnectPlugin1718861795 : TypeError: Cannot read property 'post_id' of null

Cordova 6.1.1
cordova-android@5.1.1

var options = { method: "feed", link: "https://freelibations.com", caption: $scope.user.name + " just checked in at " + $scope.listing.title + ".", picture: $scope.bogo.image };

Not sure what is going on... It does post, but there is no link or image.

@allurco
Copy link

allurco commented May 17, 2016

Alright! Changing link to href, adds the link/href and changes the share dialog. I still have he post_id issue.

@Heshyo
Copy link

Heshyo commented May 18, 2016

@allurco: Do you have the Facebook app installed? If yes can you try uninstalling it first and then try sharing again?

@robertarnesson
Copy link

895fffa

@neilmctee
Copy link

I'm seeing the same problem as the OP (feed dialog without a link) results in the dialog opening, but is completely empty.

As the OP's problem appeared to be solved by updating Cordova / Android versions (and I'm way past those recommended versions) is there a chance this has been caused by a regression?

I'm building a Meteor / Android app.... Cordova 6, Android 6.0.

Luro91 pushed a commit to platogo/cordova-plugin-facebook4 that referenced this issue Mar 9, 2021
Luro91 pushed a commit to platogo/cordova-plugin-facebook4 that referenced this issue Mar 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests