1

I have some problems understanding Facebooks API. I managed to send feeds (with a "link" and "picture") to my own Time Line, but I want them to appear on my friend's News Feed. Only without using "link" and "picture" it does appear on my friend's News Feed. I am using facebook-android-sdk and facebook-ios-sdk. Here the Android example:

Bundle params = new Bundle();
params.putString("name", "Some name");
params.putString("caption", "Some caption"); 
params.putString("link", "http://www.some-link.com");
params.putString("picture", "http://www.some-link.com/pic.png");
facebook.dialog(this, "feed", params, new FacebookDialogListener(FacebookDialogListener.DIALOG_FEED));

So how can I make a user of my app publish on his friend's News Feed with a "link" and "picture"? Please don't tell me it can't be done, because on my own News Feed I get posts with images from games regularly. How do they do this? Maybe after I posted to my own profile using "link" and "picture", can I share the object through the Facebook API? I get a POST_ID in return to "feed". Can I do something with the POST_ID to make it appear in my friend's News Feed?

j0k
  • 22,600
  • 28
  • 79
  • 90
Andrej
  • 161
  • 2
  • 14

2 Answers2

1

You can definitely use the Facebook dialog to post to a friend's timeline. Note that posting via the /feed way is going soon but you can still use the dialog.

To post to a friend's timeline, you would add another parameter, "to" and pass the friend id to it:

params.putString("to", "<FRIEND_ID>");
facebook.dialog(this, "feed", params, 
    new FacebookDialogListener(FacebookDialogListener.DIALOG_FEED));
C Abernathy
  • 5,533
  • 1
  • 22
  • 27
  • Actually I don't want to post to one specific friend's timeline, but I want to post on the News Feed so that all the friends can see it. I am able to do this with the "request" SDK. But when I use the "dialog" API the message only appears on my own wall. The strange thing is, when I do *not* use the attributes "link" and "picture" in the "dialog" SDK, then the post *does* appear on the News Feed. – Andrej Nov 05 '12 at 22:32
0

@Andrej i am not sure about in android but in iPhone you can do this buy using Graph Path @"user_fb_ID/feed" like this -

[self.facebook requestWithGraphPath:@"123456789/feed" andParams:params andHttpMethod:@"POST" andDelegate:self];

I think it will be same there in android also. First of all you need to take out your fb friend's fbID. Here params is a NSDictionary object which has some info for keys like @"message",@"link",@"image",@"name",@"description".

saadnib
  • 11,145
  • 2
  • 33
  • 54
  • Aha I seen now that this posts on the News Feed indeed! But now the user cannot add its own text. Is it possible to to this through the iOS dialog API instead of request API? Then it would bring up the dialog and the user could enter it's own text. – Andrej Oct 29 '12 at 23:28
  • Still I do not understand why I cannot use the "dialog" SDK to post to the News Feed. That is, when I use the attributes "link" or "picture", then the post ends up on my wall only, but not on the News Feed. Any idea why? – Andrej Nov 05 '12 at 22:35