【问题标题】:Facebook api return error code 100Facebook api返回错误代码100
【发布时间】:2013-02-19 22:17:04
【问题描述】:

每次我尝试通过 Facebook JS Sdk 调用发送对话框时都会收到此错误。

API 错误代码:100 API错误描述:无效参数 错误消息:“链接”无效。

这是我的代码。

初始化

     window.fbAsyncInit = function() {
            // init the FB JS SDK
            FB.init({
                appId      : '${sp.apiKey}', // App ID from the App Dashboard
                //       channelUrl : 'http://localhost:8084/facebook/callback', // Channel File for x-domain communication
                status     : true, // check the login status upon init?
                cookie     : true, // set sessions cookies to allow your server to access the session?
                xfbml      : true  // parse XFBML tags on this page?
            });

            // Additional initialization code such as adding Event Listeners goes here

        };
        (function(d, debug){
            var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
            if (d.getElementById(id)) {return;}
            js = d.createElement('script'); js.id = id; js.async = true;
            js.src = "//connect.facebook.net/en_US/all" + (debug ? "/debug" : "") + ".js";
            ref.parentNode.insertBefore(js, ref);
        }(document, /*debug*/ true));

发送对话框函数

 function sendFacebookMessage(id, jobid){

            FB.ui({
                method: 'send',
                name: 'Some text here.',
                to:id,
                link: 'www.some-url.com'

               //tomcat is running on port 8084
            });
        }  

我尝试过使用 http:// ...没有它...

每次结果都一样..'link'无效。

有什么想法吗?

【问题讨论】:

    标签: java javascript facebook facebook-javascript-sdk


    【解决方案1】:

    documentation 没有具体说明,但您可能无法在此上下文中指定 localhost 链接。该 URL 仅对您在本地计算机上有效。它不适合作为公共网站上的链接。

    【讨论】:

    • 你是对的,我的例子很糟糕,所以我编辑了它。我在我们的测试服务器上遇到了同样的问题。
    猜你喜欢
    • 2013-02-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-10-29
    • 2012-08-16
    • 2018-03-30
    • 1970-01-01
    相关资源
    最近更新 更多