Facebook publish_actions to timeline for iOS - facebook

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.

Related

post on multiple friends facebook wall

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.

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.

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 share a photos with facebook and twitter?

I have created a photo gallery application using Three20 framework. It works fine with previous, next and play button in toolbar. But i want include a button for sharing the photos with facebook and twitter.
How to make this?
Thanks in advance.....
For a single point of sharing, I think ShareKit is a great utility. You can easily extend the sharing feature to more than just Facebook and Twitter.
You need to understand the Following.
1-Facebook ApI
2-Twitter ApI
I downloaded the Facebook iOS SDK from github and made a custom view controller based on their sample. To post a photo, I used this code:
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
image, #"picture",
nil];
[facebook requestWithGraphPath:#"me/photos"
andParams:params
andHttpMethod:#"POST"
andDelegate:self];
where the facebook object is an instance of FacebookService provided in the Facebook SDK and image is a UIImage. However it's a lot more complicated than this because first you have to go to the Facebook developers site and register your app to get an App ID and Access Token, then in your app will you have to have the user autheticate your app with Facebook and handle errors, etc. You can figure it all out from their sample code in the SDK.
I haven't tried Twitter yet.
BMSocialShare should get you going.
https://github.com/blockhaus/BMSocialShare
You need to use IOS sdk from facebook here the link: Facebook for iOS SDK

like/comment on news feed programmatically through Facebook iOS Sdk iphone

I have integrated Facebook IOS SDK to my application and able to post news feed to user's wall programmatically in facebook. Now there is other requirement like in facebook we have options under each news feed of like/comment. I searched a lot for this but was not able to find anything related to this.
I am able to read the news feed from the user's wall and I have it in JSON format. I don't know the further implementation path for the same.
How can we achieve this functionality through iOS sdk?
No worries. With Legacy Rest API of facebook, I figured out how to Comment particular news feed.
//How to Like particular News FEED.
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:#"Your Comment Text.", #"text",#"NEWs_FEED_ID", #"object_id",nil];
[_facebook requestWithMethodName:#"comments.add" andParams:params andHttpMethod:#"POST" andDelegate:self];
//How to Like particular News FEED.
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:#"NEWs_FEED_ID", #"post_id",nil];
[_facebook requestWithMethodName:#"stream.addLike"