Facebook for iPhone, background wall post - iphone

I am implementing the Facebook iOS SDK into my app... and find no problems with that. BUT, what I can't find to figure out is how to send basic wall post to my facebook app wall.
What I want to do is whenever a user searches for something, the app sends a wall-post with the following text "#someUser just searched for someSearchQuery" to my apps wall (not the users wall).
Offcource this is something I want the user to be able to switch on / off in the settings page, so the user is aware of it.
How can I do this?
Best regards,
Paul Peelen

Use the new Graph API as described here:
http://developers.facebook.com/docs/api#publishing
Quoting:
"For example, you can post a new wall post on Arjun's wall by issuing a POST request to https://graph.facebook.com/arjun/feed"
To use the Graph API from Facebook iOS SDK do something like:
[facebook requestWithGraphPath:#"[your app's id]/feed" andParams:params andMethod:#"POST" andDelegate:self];
where params is a dictionary with following optional keys:
message, picture, link, name, caption, description, source

Related

Facebook photo feed

I was using FB api to post photos to my fanpage's news feed (http://www.facebook.com/MyApp/photos_stream), but from some time it stopped posting it to news feed and it just uploaded photos to some album (http://www.facebook.com/MyApp/photos).
This is the api command I was using before and after it was working, nothing has changed on my side.
$result = $facebook->api('/123456789/photos', 'post', $attrs);
So the question is, how to post photos to fanpage wall (timeline) properly and why it stopped working by itself?
Thanks
I had the same problem a few times ago.
In fact it was working but you have to go to your photo folder and accept the uploaded image.
In the album Facebook will show you a panel saying you have to approve those photos.
By doing this Facebook will publish the images on the timeline.
I know this is very annoying but I didn't find a better solution (I think Facebook has added a new security to avoid some abuses).
EDIT:
Look at the Facebook documentation.
You can post photos to a Page's Wall by issuing an HTTP POST request
to PAGE_ID/photos with the publish_stream and manage_pages permissions
and the following parameters.
Make sure you are using those two permissions and that your parameters are correct.

Iphone Posting on wall with FBConnect

I am using the latest facebook sdk.
Everything works fine even the post on wall feature.
Thing is that the post to wall dialog contains minimal information. Just a textbox and a small label reading "... via app-name".
I have used the sample code snippet which provides things like 'caption' and 'description' but these are NOT shown in the post to wall dialog.
I have seen other apps with captions, descriptions and even a large image attached to the post.
How can I show these objects (caption, description, image etc..) using the facebook sdk ?
Thanks
I don't use the Facebook SDK so I just send POST requests with the necessary values. Similar to this:
Posting on Facebook Tutorial
There's another tutorial on the same blog that does use the SDK:
Posting with the Facebook SDK

Photo posted via FB Graph API doesn't appear on the wall (and 2 more FB questions)

I post photo on the wall using Facebook Graph API, just set parameter "picture" and send POST request to "me/photos".
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
self.imageToFBPost, #"picture",
FACEBOOK_ICON_URL, #"icon",
nil];
[facebook requestWithGraphPath:#"me/photos"
andParams:params
andHttpMethod:#"POST"
andDelegate:self];
Usually (basically always) when I add photos to my PF they appear on my wall. But not in this case. I've tested yesterday about 20 times and only 1-2 times photos appeared on my wall. Basically I want them to appears on my friend's feed. Main question: is there any way to make photo appear on my wall each time she it was posted?
Second question is how to customize icon of the post? E.g. when I of mobile upload under the wall post I see this icon: . I want to see icon of my app instead. I 've set icon of my Facebook app, but it isn't showed anywhere...
3rd question is how to get link to the Facebook page with a photo?
As result of request mentioned above I receive "id" of the picture. I want to open Safari with Facebook page of uploaded picture. Is it possible? I can find only direct link to the .jpg file, but not to the FB page. I've tried to go to http://graph.facebook.com/photo_id but it does't work...
Also it isn't very clear for me ho to catch various responses in the same file. E.g. if I do login, photo posting and requesting photo info in the same class. I created request_id class variable for that and execute switch/case in method comparing request_id with constants, but this way looks "ugly" for me. Any nice solution? :)
Thanks!
1rst question: Facebook decides what to display on your friends feed. displaying one post per photo would be overwhelming so FB chooses to group your images by album into the same post.
2nd question: in your application settings page (https://developers.facebook.com/apps) you can modify the icon displayed for each one of the posts.
3rd question: each requestWithGraphPath methods return a FBRequest instance ref. Keep it somewhere and once your delegate gets called back, compare the passed FBRequest with the ones you kept asside.

Facebook URL scheme to post a new message from iPhone

I am developing an iPhone application, and want it to be able to post a message to Facebook, by using the Facebook app.
Is there a custom URL to do this?
I've found this page that has a list of Facebook commands, but it doesn't say how to post a new message...
The URL to post a new message to the wall is
fb://publish/?text=some text to post
This works with Facebook app 4.1... I don't know if it works with older versions.
This answer might help you... Especially this : fb://messaging/compose
If you are talking about using a feed post then you have to do this:
[facebook dialog:#"feed" andDelegate:self];
See here for more info
Also if your making this a mobile web app then you could try this:
http://www.facebook.com/dialog/oauth?
client_id=YOUR_APP_ID&redirect_uri=YOUR_URL&display=touch
More info on web app
You could also just use Sharekit, that gives your users the option what to share. Otherwise, you'll have to use the FBDialog from the facebook-ios-sdk or a matching webview using the URL given by the other posters
The method you mention, directly calling the facebook app, a) requires the app to be installed (usually not the case on iPads, for example) and b) is not officially supported by facebook - the two other ways are.

Facebook graph Api Problem with number of comments

Hello I am using facebook graph api..and trying to display comments of each post..But it is showing only 2 comments per post..some of my post are having more than 2 comments.. I set the limit= 10 in URL
url_string = [NSString stringWithFormat:#"%#access_token=%#&limit=10", url_string, self.accessToken];
I have searched but not found why this is happening and also I am getting only my posts which is posted from my iphone app..other friends post on my wall is not visible in my app even my post which I posted on facebook site(not from my app) is also not visible in app..
please Help about this..
Facebook for iPhone, background wall post
Check out the above link it will help..
Also make sure you have used read_stream, offline_access, user_profile included in the permission.
Here are the list of permissions you need to use http://developers.facebook.com/docs/reference/api/post/