2

I am trying to publish a story with share_open_graph using cordova_plugin_facebook4 showDialog. But when I post I got this error message: errorMessage: Facebook error: Error publishing message. I googled a lot but till now no answer. Please anyone can tell me how to fix it?

Here is the code i am using:

publish() {
    this.facebook.getLoginStatus()
    .then(res => {
      console.log(res);
      if(res.status === 'connected') {
        console.log("CONNECTED");
          let obj = {};
          obj['og:type'] = 'book';
          obj['og:title'] = 'FidSave';
          obj['og:url'] = 'https://www.facebook.com/fidsave';
          obj['og:image'] = 'https://upload.wikimedia.org/wikipedia/commons/9/99/Black_square.jpg';
          obj['og:description'] = 'Você ganhou um ponto no fidsave';
        this.facebook.showDialog({
          method: 'share_open_graph',
          action: 'og.shares',
          object: JSON.stringify(obj)
        }).then(data => console.log(data)).catch(err => console.log(err))
      }
    })
 }

Here is my system info:

Distributor ID: Ubuntu Description: Ubuntu 17.04 Release: 17.04 Codename: zesty

global packages:

@ionic/cli-utils : 1.4.0
Cordova CLI      : 7.0.1 
Ionic CLI        : 3.4.0

local packages:

@ionic/app-scripts              : 1.3.7
@ionic/cli-plugin-cordova       : 1.3.0
@ionic/cli-plugin-ionic-angular : 1.3.0
Cordova Platforms               : android 6.2.3
Ionic Framework                 : ionic-angular 3.3.0

System:

Node       : v6.11.0
OS         : Linux 4.10
Xcode      : not installed
ios-deploy : not installed
ios-sim    : not installed
npm        : 3.10.10 
Tomislav Stankovic
  • 3,080
  • 17
  • 35
  • 42
Didi
  • 21
  • 2

1 Answers1

0

You need to make sure your app is authenticated.

What's the result of the connect method?

facebookConnectPlugin.login(Array strings of permissions, Function success, Function failure)
ApriOri
  • 2,618
  • 29
  • 48
  • Hey ApriOri, i do connect to facebook with the connect plugin, i got a token, expire time and so on. so i am connected to facebook. And i am facing this issue only in the share_open_graph case, cause for share or send it works without any trouble. – Didi Jul 27 '17 at 16:58