facebook发送API错误代码:100 API错误说明:无效参数错误消息:'link'无效 [英] facebook send API Error Code: 100 API Error Description: Invalid parameter Error Message: 'link' is invalid

查看:1938
本文介绍了facebook发送API错误代码:100 API错误说明:无效参数错误消息:'link'无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Facebook的帖子GRAPH UI发布私人消息,链接到我的应用程序在Facebook。
以前它工作正常,但从最近两天开始,对话框开始抛出错误:

I am using facebook post GRAPH UI for posting private message with link to my application in facebook. Earlier it was working fine but from last two days the dialog started throwing error as :


发生错误。请稍后再试。

An error occurred. Please try again later.

API错误代码:100

API错误说明:参数无效

错误消息:'link '无效。

API Error Code: 100
API Error Description: Invalid parameter
Error Message: 'link' is invalid.

发送消息我正在使用代码:

for sending message I am using code :

function sendMessage(id) {
  FB.ui({
    method : 'send',
    name : 'My APP',
    link : 'https://apps.facebook.com/MY_APP/',
    to : id,
    show_error : 'true',
    description : 'my description'
  });
}

我已经Google Googled关于这个,只有相关信息,我得到的是Facebook正在阻止链接到自己的域以避免垃圾邮件。
当我更改链接到其他现场网站的工作。

I have Googled about this and only relevant information I get is that facebook is blocking the link to its own domain as to avoid spam. as I change the link to other live site its working.

我需要发送链接到我的应用程序,因为我必须提供这样的功能。 >

I need to send link to my application as I have to provide such functionality.

推荐答案

找到解决方案:

问题原因:

Facebook不允许使用自己的链接来阻止垃圾邮件。

Facebook is not allowing to use its own link as to stop spamming.

问题解决方案:

没有这样的解决方案就像Facebook API一样。

There is as such no solution as its bared by Facebook API.

其他锻炼:

缩短网址,但它没有作为Facebook检查提供的URL。
重定向网址,与上述相同。
在我的情况下,我已经部署了一个额外的HTML页面,仅用于重定向到Facebook App链接。
请记住,当Facebook扫描提供的URL时,您应该有几秒钟的计时器,因此无法检测到该页面正在重定向到同一个应用程序链接。
我为我的HTML文件使用了以下代码:

Shorten URL, but its didn’t works as Facebook check the provided URL. Redirect URL, same as above. In my case I have deployed an additional HTML page just use to redirect to the Facebook App link. Just remember that you should have a timer for few seconds as Facebook scans the provided URL, so it wont be able to detect that the page is redirecting to same Application Link. I have used the following code for my HTML file:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>My Application</title>
</head>
<body>
    <p id="demo"></p>
</body>
<script type="text/javascript">
    var url = "https://apps.facebook.com/MY_APPLICATION_ID";
    var myVar = setInterval(function() {
        myTimer()
    }, 1000);
    var counter = 3;
    function myTimer() {
        if (counter == 0) {
            window.location.replace(url);
            window.clearInterval(myVar);
        }
        document.getElementById("demo").innerHTML = "you will be redirected in "
                + counter + " seconds...";
        counter = counter - 1;
    }
</script>
</html>

这篇关于facebook发送API错误代码:100 API错误说明:无效参数错误消息:'link'无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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