Facebook Feed Dialog - Post without a link - facebook

I am trying to use the Facebook Feed Dialog to post a plain text message. According to the docs this should be possible by simply leaving the 'link' parameter empty'
https://developers.facebook.com/docs/sharing/reference/feed-dialog
"The link attached to this post. With the Feed Dialog, people can also share plain text status updates with no content from your app; just leave the link parameter empty."
When doing this I successfully see the share dialog, but when I enter a message and click post I am receiving the following error:
Action Requires At Least One Reference: The action you're trying to publish
is invalid because it does not specify any reference objects. At least one
of the following properties must be specified: object.
This is my code, if add a link, it works as expected.
FB.init({appId: APP_ID, status: true, cookie: true});
FB.ui({
method: 'feed',
title: "",
link: "",
caption: "",
description: "",
image: ""
}, function(response){});
Does anyone know how to successfully post a plain text message from the feed dialog?

Related

The posts fo Feed method in FB.ui are not visible in Facebook timeline

I created an Application in facebook and used in my website.
In my page I am using this function to share a photo.
function postToFacebook(url, img) {
FB.ui({
method: 'feed',
link: url,
picture: img,
name: "Sample name",
description: 'sample desc'
}, function (response) {
console.log(response);
});
}
This function is working and sending a ShareLink on my Time line. But nobody can see my post. I just can see the post on my TimeLine !!!
What it is the problem?
I found out the problem myself.
it is because of the Status of Facebook Application.
Do this setting to fix the problem:
Go to Facebook Developer => You Application => Status & Review => set this option to YES:
"Do you want to make this app and all its live features available to the general public?"

How to share individual images in facebook

I would like to enable users to share a certain feed with dynamically generated pictures. This means that the picture url is always a new one.
However, it seems that the picture Facebook is using is not that from the URL but always (an old) one from the cache.
The URL is something like http://www.domain.com/facebook/unique-picture.png
How is it possible to turn off the caching?
function shareMessage(link) {
alert(link);
FB.ui(
{
method: 'feed',
name: link,
link: 'link',
picture: link,
caption: link,
description: "description",
message: ''
});
}

Facebook API Error 100 'link' is invalid

I have my site qa.carryon.com (this is our test site). I have configured it for facebook login and send invitations. In facebook I have configured SiteURL as 'http://login.qa.carryon.com/gs/'. 'login.qa.carryon.com' is our CNAME and we are using Gigya as social third party.
Login is working fine and when users see the list of facebook friends, user will click on one of them and the facebook send dialog triggers. The link parameter for send dialog is something like this 'http://qa.carryon.com/loyalty/signup?userid=xghdt6ys&username=xyz'.
For this link am i getting the error code 100 link invalid or there is other issue in configuration. I am doing this for first time and i cant understand whats going on. Please help i am stuck with no clue.
I had this issue as well and I was using dynamic querystring parameters on a common URL. It seems you are doing the same.
I fixed the issue by forcing Facebook to scrape the URL before I attempt to send it via the FB UI Send Dialog. Use the FB API to hit graph.facebook.com with the URL posted in the id parameter and a scrape parameter set to true.
Like so:
FB.api('https://graph.facebook.com/', 'post', {
id: '[URL]',
scrape: true
}, function(response) {
FB.ui({
method: 'send',
name: '[name]',
picture: '[Picture URL]',
link: '[URL]',
description: '[description]'
});
});
Also answered here.
Does that help?

Custom image in facebook send dialog?

I am trying to send a facebook private message via facebook send dialog in my facebook app, i have a problem while setting the custom image each time user clicks on it, i am sending the parameters as
send msg
and on the function side,
FB.init({
appId: '<?=$this->facebook->getAppID()?>',
xfbml: true,
cookie: true
});
function send_message(user_id, image_name) {
FB.ui({
to: user_id,
method: 'send',
name: 'The Image',
description: 'Description here',
link: 'https://www.something.com/',
picture: '<?=baseurl()?>imagepath/'+image_name
});
}
It works fine without picture parameter, but all the time it uses default image that facebook automatically pick from my link.
please your kind help will greatly be appreciated!
Using HTTPS protocol in picture link (if you do so), you might cause your problems. Take a look at Images not working in FB.ui

FB.ui feed post dialog changes

When a user posts a comment on one of our sites, we give them the option to send the comment to their facebook wall. i.e. the following code:
FB.ui({
method: "stream.publish",
attachment: {
"name": "article title",
"href": document.location.href,
"description": "an excerpt from the article"
}
message: userComment, // The comment that the user entered on our site
user_prompt_message: shareText // "What do you think?" or similar, configurable
}, function(response){
if(response && response.post_id){
// success!
}
else{
// failed!
}
});
This popped up a dialog with the "your comment here" input pre-filled with the same comment the user posted on our site. Was totally fine via the Facebook Platform Policies, even officially encouraged at the time we initially put it into place.
But evidently they deprecated the message parameter on July 12th. So now you get a big "share" box and the content you actually want to share (the user's comment) isn't included anywhere. So, we're looking for another way to post the user's comment.
So, the latest documentation on stream.publish still says we can pass the message parameter directly via the API call, i.e.
https://api.facebook.com/method/stream.publish?callback=derp&message=EABOD+Facebook&access_token=MY_ACCESS_TOKEN&format=json
I tested it and it works, but I'm wondering if it will still work going forward, or if they just haven't shut it down yet?
If it'll replaced, i will be the feed method, which is very similar to streem method.
FB.ui(
{
method: 'feed',
link: 'http://myapp.com/myitem',
display: 'iframe',
picture: 'http://myapp.com/mylogo.jpg',
message: 'my message',
name: 'click to see item',
caption: 'title'
})
we will see next major version and see!