Publising some thing to facebook friends feeds - facebook

Salam, Hi and Hello,
I am using FB.ui method of Facebook Javascript SDK and it says, "post to your wall", I want to publish story on facebook friend's wall or in feeds. So is it possible to post story on friends feeds other than your own wall? If yes then how? I doubt that it was only possible in depreciated libraries?
I am currently using following code:
FB.ui({'method': 'stream.publish',
'from':from_user_id,
'display':'iframe',
'attachment':attachment,
'description': '',
'message': message,
'user_prompt_message': "Personailze Message",
'action_links': [
{ text: 'AppName', href: canvasURL }
]
},
function(response){
});
A Dialog is appearing but it says, "Post to Your Wall"
But What I want is that it say post to Your wall and Your Friends Home Page? as here:
http://thinkdiff.net/facebook/graph-api-iframe-base-facebook-application-development/
I followed this tutorial but it is still saying: "Post to Your Wall"
So is there any clue? That How can I achieve the intended functionality? Waiting for your response.
thanks in advance
thanks

If you want to post on any friends wall you have to add the friends id so it'll look like this
FB.ui(
{
method: 'feed',
name: 'NAME',
link: 'LINK OF THE WEBSITE OR PAGE',
picture: 'IMAGE_URL IF YOU NEED IT',
caption: 'Reference Documentation',
description: "DESCRIPTION",
to:FRIENDS_ID
},
function(response) {
if (response && response.post_id) {
alert('Post was published.');
} else {
alert('Post was not published.');
}
}
);

Related

Facebook jssdk customizes the shared feed interface. Why don't the parameters of picture work?

According to the official Facebook document,url:https://developers.facebook.com/docs/sharing/reference/feed-dialog
But the parameters in the "Deprecated Parameters" column below do not work.
Is the interface function turned off?
I hope someone can help me. Thank you.
FB.ui(
{
method: 'feed',
name: 'Facebook Dialogs',
redirect_uri:location.href,
link: location.href,
picture: 'https://pic3.zhimg.com/80/37e17fa3d5d60f9e8bcba3bdc7e7dc06_hd.jpg',
caption: 'Reference Documentation',
description: 'tDialogs provide a simple.',
message: 'tFacebook Dialogs are easy!'
},
function(response) {
if (response && response.post_id) {
console.log(response)
alert('Post was published.');
} else {
alert('Post was not published.');
}
}
);
But the parameters in the "Deprecated Parameters" column below do not work.
That is why they are in the deprecated section (deprecated means "old" or "gone"), they don´t work anymore since a very long time. You have to provide that data with Open Graph tags in the source of the shared URLs.
More information about Open Graph tags: https://developers.facebook.com/docs/sharing/webmasters/#markup

Facebook Direct Messages for Mobile Devices Options

Now that Facebook rolled out their new policy in February 2013 where, among other changes, apps cannot post on friend's wall; and Send Dialog is not supported for Mobile Devices.
What options do we have to post on a user's friend wall (on behave of the user already authenticated with an app) using mobile devices?
You can use feed dialog or redirect the user to a mobile friendly url by adding display=touch and *to=FRIENDS_ID* and show a dialog box.
To display a mobile-friendly Feed Dialog, redirect the user to the following URL:
http://www.facebook.com/dialog/feed?client_id=YOUR_APP_ID&redirect_uri=YOUR_URL&to=FRIENDS_ID&display=touch
Using feed dialog and javascript api
function postToFeed(kompis) {
// calling the API ...
var obj = {
method: 'feed',
redirect_uri: 'http://url.nu',
link: 'http://www.url.se',
picture: 'http://url/tfc.gif',
name: 'Facebook Dialogs',
caption: 'Reference Documentation',
description: 'Using Dialogs to interact with users.',
display:'touch',
to:kompis
};
function callback(response) {
if (response && response.post_id) {
alert('Post was published.');
document.getElementById('status').innerHTML = "Post ID: " + response['post_id'];
} else {
alert('Post was not published.');
}
}
FB.ui(obj, callback);
}
ps: when I try it in firefox I set my User Agent to "iphone" otherwise it would'nt work!
open facebook app.first open your account.open yuor profile.edit your number.ok the option 'get notifications by sms'.save the options.

Facebook App Stream_publish

I'm trying to make my facebook application autopost to a wall after they have accepted the permissions, ived tryied alot of things but i just cant get it working.
This is one of the things ived tryid:
FB.ui(
{
method: 'feed',
to: friendId,
name: 'title',
link: 'http://host.com/title_link.com',
picture: 'http://host.com/image.jpg',
description: 'description',
caption: 'caption',
},
function(response) {
// Check for a posting to wall
if (response && response.post_id) {
// do some logging
}
}
});
Is there anyone that got a sample code :)?
Maybe, your example is not working because there is one comma too much after
caption: 'caption'
.

Facebook C# SDK version 5.2.1 sample code to post to User wall

I am using Facebook C# SDK version 5.2.1 in Iframe App. I want to post something like images, links or videos to User Wall.
Is it possible to do the same using javascript SDK?
Please refer some sample codes or links that i can use for C# or javascript SDK..
https://developers.facebook.com/docs/reference/javascript/
FB.ui(
{
method: 'feed',
message: 'getting educated about Facebook Connect',
name: 'Connect',
caption: 'The Facebook Connect JavaScript SDK',
description: (
'A small JavaScript library that allows you to harness ' +
'the power of Facebook, bringing the user\'s identity, ' +
'social graph and distribution power to your site.'
),
link: 'http://www.fbrell.com/',
picture: 'http://www.fbrell.com/f8.jpg',
actions: [
{ name: 'fbrell', link: 'http://www.fbrell.com/' }
],
user_message_prompt: 'Share your thoughts about RELL'
},
function(response) {
if (response && response.post_id) {
alert('Post was published.');
} else {
alert('Post was not published.');
}
}
);

name description caption don't appear in the wall post

using Facebook Javascript SDK (since FBml doesn't work anymore), posting to a wall using my facebook app does not display name, description and caption at all. I tried adding a link and display, removed description as well, none seems to fix the issue.
Any help or note on this is helpful.
var description = $(this).parent().parent().children('.description').html();
var name = $(this).parent().parent().children('.name').html();
FB.ui(
{
method: 'feed',
attachment:
{
name: name,
caption: 'Test App',
description: description,
link: appLink,
href: appLink
},
action_links:
[
{ text: 'Test App', href: 'appLink' }
]
},
function(response)
{
if (response && response.post_id)
{
alert('Post was published.');
}
else
{
alert('Post was not published.');
}
}
);
This is actually a facebook bug. I've reported it to Facebook but haven't got any feedback since December 2011 after they've confirmed it a bug and assigned medium priority. Cheers.