What is the fundamental difference between uploading photos to an album or posting directly to the users wall? I want to provide the user with the best experience possible on my application, I also want to use an approach that also benefits my application in terms of social promotion.
Well, it's the same as when done manually, isn't it? Posting to wall gives you one post with photo in it, and posting to album gives you link to album with some thumbnails on your wall.
Using the Realtime Updates I can get notified when a user uploads a photo, but is it possible to get notified when one of their friends uploads a photo?
According to the docs you can't subscribe to changes to User.home (the user's news feed). This is where you would see friends' photos, so I conclude you can't get notifications for these events.
So from reading around a bit on this issue, it is becoming apparent to me that I cannot post an image/photo from my app to my wall as a source attachment. The only way I can show an image in a wall post is by linking to an image on the internet. I can only post a photo form within the app to the photo album on facebook.
So my question is, does anyone know how I can get my in-app image posted to my facebook wall (and not posting the image to the photoalbum)?
Sounds like you have the same problem I had just a couple of weeks ago. Did you also get the error message starting "FBCDN image is not allowed in stream..."?
It seems you've already figured it out, but since Facebook isn't quite as informative towards developers as they could, other readers may benefit from this, too.
Your app can easily send photos to the user's Facebook photo album
Your app can easily post to the user's News Feed
You can even use Facebook Graph API to pick up the ID of the photo you just sent, and use that to assemble the URL for the photo (the URL works just fine – typing it into your browser will show the photo, no problem)
BUT your app simply cannot use the photo URL in any News Feed Posts. And contrary to what one might assume, this is not a bug or any other problem you could fix, but a Facebook policy since summer, 2010.
Here's the official RSS feed stating their decision:
Serving Images in Stream Stories Jun 18, 2010 3:21pm
We no longer allow stream stories to contain images that are hosted on
the fbcdn.net domain. The images associated with these URLs aren't
always optimized for stream stories and occasionally resulted in
errors, leading to a poor user experience. Make sure your stream
attachments don't reference images with this domain. You should host
the images locally.
In conclusion, if you must have the News Feed post, you need to host the photos on your own server and link to them in the post, as Siegfried said. Although, some successful developers would argue that if you want to make your app scalable, in case it becomes the next big thing in App Store, avoid using your own server (See the Pulse News app's makers comments here: http://itunes.apple.com/us/itunes-u/developing-apps-for-ios-sd/id395631522# - hack #3)
As for me, since my app's so tiny, and I'm a small-time developer, it didn't make sense to start hosting stuff on a server of my own, so I just settled to uploading the photo to the user's Facebook account anyways and using the photo caption to tell the user's friends what I had to say, instead of the wall post.
I think you should use a server with some php scripts - then use ASIHTTP library or sth similar to upload your photo there - as a result you should get a link to the photo on your server. then use it while publishing to fb.
sounds scary but it's not that bad - ASIHTTP is very straightforward, there are tons of php scriptw for uploading photos on the net
Facebook now allows images in the wall posts that are hosted on fbcdn.net domain. It may not completely answer your question as you don't want the images in the photo album. But here are the steps.
Get photo_upload permission from the user
Once granted, upload photo to an album (users can only post photos to their own albums)
In the callback, you get the id of the photo object just posted.
Get properties for this photo object via another graph api call.
In the callback, you get all the properties - search for the object url
Create a wall post and use the retrieved url (in step 5) in the attachment.
It will display the image in the wall post. However, if you don't want to upload images to user album, you still need to host the image somewhere before you can include the link.
I asked this question a while ago and figured out an answer too. Here you go:
Facebook Connect on iOS - Picture doesn't display with wall post
I need to pull all the updated data (wall posts , photos in albums etc) from a facebook page to my application.
currently what I am doing is frequently polling the page wall feed and other non wall post objects(like albums ) and then save the updated fields.
I'm using Graph API .
I tried facebook real-time. But its not giving enough details.
Is there a way to receive notifications from pages via graph API once post or any object of the page get any update ?
In theory this is now available through Facebook's real-time updates, at least for wall posts and photos. In practice, I'm having trouble getting it to work.
I'm doing a FB app where users are able to upload a photo to a photo album that is created at the same time. My problem is that I only want the photos to go into the album avoiding the post of the same photos on the users wall and in the users news feed.
Not sure if that's possible or if there's a workaround.
Thanks for your help
You just need to use the parameter no_story=1 within your call.
This is not documented on Album or Photo, but is on User and it works for Photos as well.
Related to: facebook upload photo without news feed post? Possible?
The only way to work around this is to delete the stories (posts) generated for each photo upload. To answer another question in the thread you can do batch photo uploads, see this blog post https://developers.facebook.com/blog/post/493 that explains how to do this using Batch Requests.
Assuming you used batch requests (or even if you upload one at a time) you can follow this process:
After uploading the photos through Graph API, note the id of the photo(s) uploaded.
Make a call to https://graph.facebook.com/me/feed?fields=object_id&access_token=youruseraccesstoken to get your latest wall post information. You may choose to pass on a limit parameter so you do not get too many results.
Loop through the results, looking to match the object_id to the information saved in step (1). Note the corresponding id, these are the wall post id(s).
For each wall post id found in step (3) issue an HTTP DELETE to https://graph.facebook.com/POST_ID with an access_token that has publish_stream access.
The wall posts should be gone but the photos still in the album.