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