post on multiple friends facebook wall - iphone

I make application with only one facebook wall post. It works good for me using FBConnect. but now i want wall post to multiple friends at a time on one button click. Is it possible for post on multiple friends wall? If it is possible then suggest me.
My Code :
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
[NSString stringWithFormat:#"%#",[[arrData objectAtIndex:i] objectForKey:#"id"]], #"to",
#"post on facebook", #"name",
#"facebook wall post", #"description",
#"http://m.facebook.com/apps/myapp", #"link",
nil];
AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
[[delegate facebook] dialog:#"feed"
andParams:params
andDelegate:self];
Please reply me.
Thanks in advance for help.

If you are using the feed dialog then you have no choice but to open a dialog per friend.
What you can do though is request the publish_stream parameter which lets you publish as the logged in user on his or his friends walls.
After you get that permission you simply send a request to fb and it gets published, without the use of a dialog, which let's you send as many requests as you like.
On the ios sdk it's done with Requests.

If you already know how to post users wall then you can do this task using following approach, Or see this link for help
Get Face book fiends id for all your friends.
Save in array.
Iterate loop array's length and post one by one on friends wall.

Related

Facebook API Post Message On Friends Wall

I want to ask how to implement text view in Facebook API. I want to post message on friends wall and also how to get friends list and personal details from Facebook.
You have to use the IOS Facebook API. They created a quite detailed Introduction page.
Have a look here:
https://developers.facebook.com/docs/mobile/ios/build/
This image shows the whole process from authorization till publishing something on the news feed. (Also copied from the Facebook Developer tutorial)
Describing the process to get the friend list:
Facebook Api to check in users in an iOS app
Due to many of errors and many of negative comment about Open Graph API in facebook ios 6.
facebook remove the " Post to friends wall via the API ". You can only use the fbconnect of ios 5.
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
#"100004925467891", #"to",
#"http://pri.com/pit.png", #"picture",
#"http://pr.com", #"link",
#"Data", #"caption",
#"data",#"description",
#"Birthday Reminder",#"name",nil];
[[delegate facebook] dialog:#"feed" andParams:params andDelegate:self];
But if u Post to own wall Open Graph API is still working.

Facebook publish_actions to timeline for iOS

After searching Facebook developer documentation / bugs, and questions on stackoverflow.com, it's not clear if Facebook now supports publish_actions to timeline via it's iOS SDK. There are some questions here on this site that relates to publish_actions permission on mobile, but they don't provide any solution.
Has Facebook rolled out publish_actions for mobile for all third party apps or is it still restricted to devs?
Does Facebook allows publishing actions to timeline via it's publish_actions permission via iOS SDK?
Are there any examples, sample code, or tutorials that explain how to achieve it on iOS?
I'd appreciate any pointers.
Yes. Publishing actions works from within iOS just like it works on the Desktop Web, Mobile Web and from within Android.
The method of requesting the publish_actions permission is the same is uses to request any other permission.
The method of publishing actions is the same Graph API call as you make from any platform:
POST https://graph.facebook.com/me/APP_NAMESPACE:ACTION_NAME?OBJECT_NAME=OBJECT_URL&access_token=TOKEN
for example
POST https://graph.facebook.com/me/myapp:cook?recipe=http://exmaple.com/recipe&access_token=TOKEN
In Objective C you might have something like
AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
[[delegate facebook] requestWithGraphPath:#"me/myapp:cook" andParams:#"http://exmaple.com/recipe" forKey:#"recipe"] andHttpMethod:#"POST" andDelegate:self];
I cannot make this work. I have already got my action released by Facebook so sample had been sent from CURL, but from IOS I always get back domain error 1000.
Here is my code:
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
#"http://itunes.apple.com/us/app/ginos-challenge/id509946175",#"og.url",
#"Played on Gino's challenge",#"og:title",
#"http://media.appspy.com/thumbs/images/icons/i509946175_jpg_180x180_q85.jpg",#"og:image",
#"This is my first post",#"og:description",
#"1000", #"game_point",
nil];
// Publish.
// This is the most important method that you call. It does the actual job, the message posting.
[facebook requestWithGraphPath:#"me/[action domain]:[action name]" andParams:params andHttpMethod:#"POST" andDelegate:self];
No, publish_action will not support for posting in timeline. You should add a new tag like fb:explicitly_shared. Set this as BOOL value. If you set true, it will show in the user's timeline, else it will not.

Is it possible to post a message on the wall without a dialogue in iphone app using fbconnect?

I'm using facebook connect for my iphone application. I need to be able to post messages on the wall WITHOUT USING PROMPTING DIALOGUES. All i wanna do is enter text into a textfield and then post the text on the wall by clicking a button. Is it possible to implement this?
This is explained in the tutorial here.
https://developers.facebook.com/docs/mobile/ios/build/#socialchannels
If you DON"T want to use dialogs then you need this.
http://developers.facebook.com/docs/reference/iossdk/request/
http://developers.facebook.com/docs/reference/rest/#publishing-methods
Also see this answer: iOS Development: How can I get a Facebook wall post to show in the friend's news feed?
I'm assuming that you have successfully authenticated the facebook and you have a valid object of facebook.
NSString *message = [yourTextField text];
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:message, #"message",nil];
[facebook requestWithGraphPath:#"me/feed" andParams:params andHttpMethod:#"POST" andDelegate:self];

How to post both text, image and link at once on friends' walls via facebook API

How to let someone post on his/her friends' walls via facebook API, similar to instagr.am iPhone application lets you post on your own wall?
How to show a list of friends and allow selecting them?
How to post both text, image and link at once?
As it happens, Facebook has an iOS SDK available, and instructions on how to use that to post feed items (either with an interactive dialog, or with their Graph API).
i did this way. it works fine.. u can post for multiple frnds as well.
NSMutableDictionary* params1 = [NSMutableDictionary dictionaryWithObjectsAndKeys:
<appId>, #"api_key",
#"Happy Birthday....", #"message",
#"http://www.youtube.com/watch?v=wFh-rX_Sfhs", #"link",
#"http://www.99desi.com/wp-content/uploads/2011/03/Happy-Birthday.jpg", #"picture",
#"Many More Happy returns Of the Day...", #"name",
#" Believing hear, what you deserve to hear..", #"description",nil];
[facebook requestWithGraphPath:#"<frnd-ID>/feed" andParams:params1 andHttpMethod:#"POST" andDelegate:self];
u can iterate the above step to post same to multi friends.
hope it helps you...

iOS Development: How can I get a Facebook wall post to show in the friend's news feed?

I'm integrating Facebook into my iPhone app and I have the code working to publish a post to the user's wall after they login, but I've noticed that the post doesn't show up in the user's news feed that's seen by the user's friends. Instead, it only shows up on the wall of the user. Here's my code...
- (void)publishStream
{
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
#"Post a message on your wall", #"user_message_prompt",
#"Hello, World!", #"message",
nil];
[facebook dialog:#"feed"
andParams:params
andDelegate:self];
}
How can I have it show up in the news feed as well? I should mention that the only permission I have set is 'publish_stream' which, as I understand it, is the only permission I need.
Thanks so much for your wisdom!
You need to post to your friends feed, Easy way would be to adapt your code to use the appropriate graph method with the persons you wish to post to facebook ID (i've assumed here you have stored this from an earlier call the graph api in person.facebookID)
[facebook requestWithGraphPath:[NSString stringWithFormat:#"%#/feed/",person.facebookID] andParams:params andHttpMethod:#"POST" andDelegate:self
http://developers.facebook.com/docs/reference/api/post
To get a list of the users friends use the graph path me/friends
[facebook requestWithGraphPath:#"me/friends" andDelegate:self];
Which will return a JSON list of the users friends names and their Facebook ids, to the appropriate delegate method from FBRequest, its probably worth wrapping this set of results into a set of person objects or storing the returned NSDictionary so that you can retrieve individual friends, its upto you how you process the list of returned friends (you probably want to use a UITableView to display the user friends or filter based on some other input from the user)
Using this method will mean you do not have to use the Facebook dialogs in the iOS sdk, which does mean there is an upper limit to how many messages the user can post in a day using your app
If you wish to use a dialog you will need to include the "target_id" in your params dictionary and set this to the persons Facebook ID you wish to post to