Facebook app posting to timeline not home screen - facebook

I have a facebook app. It allows users to post some data through the app. I have used the following code:
$facebook->api("/me/feed", 'post',
array('message'=> 'Hello',
'link'=> 'The link goes here',
'picture'=> 'URL to picture',
'name'=> 'Something',
'caption'=> 'Some Caption',
'description'=> 'Comment',));
The above piece of code is posting the message to User timeline. However, it does not appear on the home screen (The screen that appears as soon as a user logs in).
Please let me know if I have missed some necessary configuration. Thanks.

You cannot force a story onto the Newsfeed of friends. Facebook's algorithms will determine if the post is relevant to each individual friend, and will insert that post into his or her newsfeed if it is. There's absolutely nothing you can do about it.

Related

Hide application link from Facebook share (on page tabs)

I'm trying to find out whether it's possible to remove or change application link from feed post when sharing a page tab ("XX minutes ago from [app name]" next to comment and like links where [app name] is a link to the application). But the application in question only provides a custom page tab, not a real application, so it's kind of annoying when users are pointed to the app page.
I'm using FB.ui share the page tab.
Or maybe someone has alternate solution to make the user experience better?
Here's the share code (with some modifications since the app isn't public yet :)
FB.ui({
method: 'feed',
name: 'name of the page tab',
picture: 'http://url/to/image.png',
link: 'http://url/to/page/tab',
caption: 'caption',
message: 'message',
description: 'description',
actions: [
{
name: 'Participate',
link: 'http://url/to/page/tab'
}
]
}, shareComplete);
*edit: just saw that the question was two years ago, oh well, I'll just leave this here for future reference :P
What I did was create a redirect.php on my server that just does a redirect to the page tab I want:
<?php
header('Location: PAGE_TAB_URL');
exit();
?>
then, on tha facebook app, I added a website as a new platform and enetred the redirect.php url as the the site url.
Now, on the share ui, when the user clicks on the app name it redirects them to the page tab. Only downside that the redirect url is visible on mouseovering the link but I can live with that.

Facebook graph post on feed is not visible in newsfeed

I am trying to create an application that posts specific information on a user's wall. This message should also be visible in the newsfeed, but this part is where it goes wrong.
I 'post' following information to the feed graph:
<?php
array(
'link' => string 'https://www.facebook.com/page' ,
'picture' => string 'http://...../picture.png' ,
'name' => string 'Name' ,
'caption' => string 'caption' ,
'description' => string 'info text' ,
'message' => string 'message'
)
?>
(All the information is filled in with usefull information, but for this question I made it quicker readable).
The information comes on the user's wall, but not in the news feed. This happens also from the user's side of the story: He can see the post on his wall, but not in any feed. Also when we try with other friends.
I also tried to only post a message (without link and picture), but it still is not visible in the general newsfeed.
The auth permissions are set and available (publish_stream) and the permissions are also correct when I look at them on the wall. I use the same code as an older app. Maybe it is a setting on the developer page? Sandbox mode is off...
Can somebody please help me?
Thank you!
I think it may be releated to the fact you're sending a link, apparently FB doesn't like this anymore :
"
Updating a User's Status
You can use this method to simply update a user's status. When you do so, the status message appears at the top of the user's profile and on the Friends > Status Updates page. The message also appears in the stream with your application icon.
To use this method to set a user's status do the following:
* Do not include an attachment or action link. If you do, the story will get published and will appear in the stream and on the user's Wall only. It won't appear at the top of the profile or in the Status Updates page.
* Make sure the message is no longer than 420 characters. Otherwise, an error gets returned.
"
as per http://developers.facebook.com/docs/fbjs/streamPublish/
What Facebook chooses to display on the newfeed is done via algorithm. There are options each user can set to view items in the news feed. Recent Stories first and Popular stories first. If the popular is selected, then facebook algorithms kick into overdrive. If recent stories, then it should display all available stream items (based on other privacy settings) into the feed.
Read this if your still wondering why auto posts and api feeds are not showing on the main news feed to others! Facebook dont like us saving our time they want us to sit on there site and supply quality posts and not focus on our own website!
https://developers.facebook.com/docs/public_feed/

Posting a photo to the wall

Is it possible to post a photo to the wall (and not to the album created for the application)?
I thought about iterating through all of the user's albums and posting to the one called "Wall Photos", but wonder if there is a more elegant way?
Thanks
You can use the FB.ui method from the Javascript SDK. If you provide the URL for the image as the link and picture parameter. This will create a wall post for the active user that has an image, a title, caption, description, etc. And the image and title will link to whatever URL you have provided.
FB.ui({
method: 'feed',
name: 'Name Goes Here',
link: 'link to the image',
picture: 'link to the image',
caption: 'caption goes here',
description: 'description goes here',
properties: ''
},
function(response) {
//You can check the response variable to see if the post has been created
}
);
Albums have a type that you can see when requesting /albums in the Graph API, so instead of checking for name you can check for this.
Eventually used the method listed here https://developers.facebook.com/blog/post/526/ .
First uploaded the photo and then linked to it using object_attachment.

Facebook Tab / Post on user wall

I'v developed a Facebook tab in PHP and it pulls al the content from my web server.
When I try to post on a users wall using the following javascript code
FB.ui(
{
method: 'stream.publish',
name: 'Foo Bar',
picture: 'https://www.foobar.com/fb/img/pic_small.png',
caption: 'Caption',
description: 'Decription',
message: 'Message',
},
Facebook responds with the following error
API Error Code: 191
API Error Description: The specified URL is not owned by the application
Error Message: redirect_uri is not owned by the application
I found that one way to avoid this error is to register the tab as App on Facebook
and provide the Canvas URL and the Secure Canvas URL.
But what if I don't want the tab has an apps.facebook.com/appname entry url
I mean that what I want is just a FB Tab and not an app.Are there any other alternatives to post on users wall but of course using the standard fb Dialog Box ?
Thank you in advance for your time and for any help
I think that you are using old-fashioned FB.ui method type. Please, check the method 'feed'.
http://developers.facebook.com/docs/reference/dialogs/feed/
BTW, how about checking 'App Domain' setting or 'Website' setting. I also had a similar symptom a few weeks ago, then I just set the App Domain and Website URL as my domain. Yes, I know, it's very tricky ;)

How to make users select their friends and post on their wall in facebook

I know this has been asked several times before, but Facebook changes its api often so comes the necessity to ask this question again.
I have an iframe application, how to make users select their friends and post on their wall the message which comes out of my application in facebook using FB.ui ? or some other better method.
The simplest way to do this is via the "send" widget. http://developers.facebook.com/docs/reference/plugins/send/
If you have the stream_publish right from the user, you can also fetch his friends, let the user selects the friends he wishes to post to, and than in a loop you post to this users via graph api on the wall. (without the stream_publish right, you would have to open a fb.ui for EACH of the friends the user wants to post to.
for share to friend:
FB.ui({
method: "apprequests",
display: "iframe",
message: 'take a tour to my app',
data: '123'
});
for post to wall:
FB.ui({
method: 'feed',
link: 'http://myapp.com',
display: 'iframe',
message: 'take a tour to my app',
name: 'Click to view my app',
caption: 'Hello my app'
});