0

I would like my iPhone app to be able to post a static message to a user's friend's facebook wall. Something like it shows the static message up above, and then a place to type in friends name and shows suggested friends. Is this done through graph api, or is there a key of permissions that the POST method can use?

user717452
  • 33
  • 14
  • 73
  • 149

2 Answers2

1

Looks like this might be what you are after.

From the link:

"You just have to send your friend's Facebook ID as a parameter under the key "target_id".

set a parameter under the key @"target_id" on the parameters dictionary (when invoking dialog:andParams:andDelegate: on the Facebook object).

Here you have a sample post using the new sdk (the one that uses graph api):

    NSMutableDictionary* params = [NSMutableDictionary dictionary];
[params setObject:@"Some text" forKey:@"user_message_prompt"];
[params setObject:@"another text" forKey:@"action_links"];
[params setObject:@"Yet another text" forKey:@"attachment"];
[params setObject:@"SOME FACEBOOK ID" forKey:@"target_id"];

//At some point you need to create the following Facebook instance

[facebook dialog: @"stream.publish"
    andParams: params
    andDelegate: self];
Community
  • 1
  • 1
Darcon
  • 219
  • 2
  • 7
  • I've seen that one, but it seems to require you know the facebook id. Is there anyway to pull up the window with a list of suggested friends or type to add a friend to send it to? – user717452 Jun 26 '12 at 20:57
  • The following should return a list of the logged in user's friends. [_facebook requestWithGraphPath:@"me/friends" andDelegate:self]; – Darcon Jun 26 '12 at 22:38
  • After you return the list of friends, is there a way to then present the message with the list of friends as recipients? – user717452 Jun 27 '12 at 00:18
0

you first need to request the friend list and then provide an interface in your app where user could select which friend's wall he want to write on... :) afterwards, you can pass the selected friends id to the dialog you are presenting to the user... Atleast I am used to do it this way and it seems to be a pretty standard way of publishing something on user's wall... hope it helps

Obaid Maroof
  • 1,523
  • 2
  • 19
  • 40
  • Thanks, but how do you request the friend list? – user717452 Jun 26 '12 at 22:04
  • Thanks, but how do you request the friend list? – user717452 Jun 26 '12 at 22:31
  • To get list of friends you can use [link](https://graph.facebook.com/me/friends) ---> [facebook requestWithGraphPath:@"me/friends" andParams:nil andDelegate:self]; To know more about all the possible API please read [this](https://developers.facebook.com/docs/reference/api/) – Obaid Maroof Jun 28 '12 at 10:05