[英]Facebook api return error code 100
I got this error every time i was trying to call Send dialog via Facebook JS Sdk. 每次尝试通过Facebook JS Sdk调用“发送”对话框时,都会出现此错误。
API Error Code: 100 API Error Description: Invalid parameter Error Message: 'link' is invalid. API错误代码:100 API错误描述:无效的参数错误消息:'link'无效。
Here is my code. 这是我的代码。
Init 在里面
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));
Send dialog function 发送对话框功能
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
});
}
I've tried with http:// ...without it... 我尝试过http:// ...没有它...
every time the result is same .. 'link' is invalid. 每次结果相同..“链接”无效。
Any ideas? 有任何想法吗?
The documentation isn't specific on it, but you likely can't specify a localhost
link in this context. 该文档不是专门针对此文档的 ,但是您可能无法在这种情况下指定
localhost
链接。 That URL is valid only for you on your local machine. 该URL仅对您在本地计算机上有效。 It's not suitable as a link on a public web site.
它不适合作为公共网站上的链接。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.