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 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'
});
}
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.
I've had similar issues, and figured I'd share the results of my investigation here.
The only information in the Facebook documentation describing the link
parameter is not terribly helpful:
link -The URL that is being sent in the message.
this problem ended up being a malformed
picture
parameter
"The issue revolved around our url being dynamic and needing force caching each time. I now make an ajax call to "https://developers.facebook.com/tools/debug/og/object" to refresh it and then launch the send dialog."
link
parameter, but...Making some inferences from the above questions & responses, as well as some testing on my part, valid link
parameters:
http://
or https://
facebook.com
linksApparently Facebook has some sort of link crawling mechanism that performs some unknown tests on a link
parameter to determine its validity. I only wish they would choose to document it for us.
Found a solution:
Problem Cause:
Facebook is not allowing to use its own link as to stop spamming.
Problem Solution:
There is as such no solution as its bared by Facebook API.
Other workout:
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With