【问题标题】:FB.ui share_open_graph errorMessage : "Facebook error: Error publishing message"FB.ui share_open_graph errorMessage:“Facebook 错误:发布消息时出错”
【发布时间】:2017-07-27 13:22:14
【问题描述】:

我正在尝试使用 cordova_plugin_facebook4 showDialog 发布与 share_open_graph 的故事。但是当我发布时,我收到了这个错误消息:errorMessage:Facebook error: Error publishing message。我用谷歌搜索了很多,但直到现在没有答案。请问谁能告诉我怎么解决?

这是我正在使用的代码:

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

这是我的系统信息:

分销商 ID:Ubuntu 说明:Ubuntu 17.04 发布时间:17.04 代号:热情

全局包:

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

本地包:

@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

系统:

Node       : v6.11.0
OS         : Linux 4.10
Xcode      : not installed
ios-deploy : not installed
ios-sim    : not installed
npm        : 3.10.10 

【问题讨论】:

    标签: facebook cordova-plugins ionic3 share-open-graph


    【解决方案1】:

    您需要确保您的应用已通过身份验证。

    connect方法的结果是什么?

    facebookConnectPlugin.login(Array strings of permissions, Function success, Function failure)
    

    【讨论】:

    • 嘿 ApriOri,我确实使用连接插件连接到 facebook,我得到了一个令牌,过期时间等等。所以我连接到 Facebook。我只在 share_open_graph 案例中遇到这个问题,分享或发送它的原因没有任何问题。
    猜你喜欢
    • 1970-01-01
    • 2011-07-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-08-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多