没有回调与FB.ui [英] No callback with FB.ui

查看:185
本文介绍了没有回调与FB.ui的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法让Facebook UI回调运行。我使用了FB开发网站的例子:

I can't get the Facebook UI callback to run. I've used the example from the FB dev site:

https://developers.facebook.com/docs/reference/dialogs/feed/

FB.init({appId: "YOUR_APP_ID", status: true, cookie: true});

function postToFeed() {

    // calling the API ...
    var obj = {
      method: 'feed',
      redirect_uri: 'YOUR URL HERE',
      link: 'https://developers.facebook.com/docs/reference/dialogs/',
      picture: 'http://fbrell.com/f8.jpg',
      name: 'Facebook Dialogs',
      caption: 'Reference Documentation',
      description: 'Using Dialogs to interact with users.'
    };

    function callback(response) {
      document.getElementById('msg').innerHTML = "Post ID: " + response['post_id'];
    }

    FB.ui(obj, callback);
}

当我在我的网站上运行它时,我没有回调
< a href =https://www.ipassexam.com/page/fb-test =nofollow> https://www.ipassexam.com/page/fb-test

When I run it on my site I get no callback https://www.ipassexam.com/page/fb-test

任何见解都将不胜感激。

Any insight would be appreciated.

推荐答案

摆脱redirect_uri参数。这对每次都有效:

Get rid of the redirect_uri parameter. This works for me every time:

FB.ui({
    method: 'feed',  
    link: "http://...",
    name: "Some Title",
    caption: "Some Caption",
    description: "Some Description",
    picture: "http://..."
}, function(response) {
    if (response && response.post_id) {
        alert('Post was published.');
    } else {
        alert('Post was not published.');
    }
});

还要确保控制台中没有错误。但是我没有看到任何错误。

Also make sure that there are no errors in the console. But i did not see any error anyway.

这篇关于没有回调与FB.ui的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆