views:

989

answers:

2

Hi,

You can integrate Facebook Connect in your iPhone application to interact with Facebook and perform operations like updating status, posting link etc.

To post status update to Facebook, you require extended permissions. To get extended permissions Facebook Connect shows a dialog for authentication (with username and password field).

I want to use my custom view to get Facebook username and password just once and store it in a local database (or NSUserDefaults), so that i can use these credentials to perform operations like updating status and posting link without showing the authentication dialog ever again - even when user quit's and relaunches the application the next day.

Can i bypass the built-in Permissions Dialog and perform the operations like posting the status and posting links to Facebook in the background?

  1. Authenticate using pre-saved credentials, and on success
  2. Update Facebook status

I can do that with Twitter. It doesn't require me to show any authentication/permissions dialog to authenticate before posting the tweets.

Any ideas? Thanks.

Note: Editted the post to make it clear.

+1  A: 

I wouldn't recommend it. Probably a violation of the API's terms of use.

Noah Witherspoon
I think it would be OK if he were to use a presaved user id and password so that the user didn't have to type it in again. I have no ida how to do it though.
mahboudz
@Noah, i suspect that too. I'm just to lazy to read the terms of use :), plus i was hoping someone might present a solution.@mahboudz, i do want to save the username/password but that too using my own custom interface. Not via API interface that uses UIWebView.
Mustafa
+2  A: 

You cannot store the user's email and password. This is a violation of the terms of use as Noah mentioned.

What you can do is prompt the user once logged in for the offline_access and publish_stream extended permission (http://wiki.developers.facebook.com/index.php/Extended%5Fpermission) which will stop their session from expiring.

This means you can store the session key in your database along with the uid and will have the ability to perform certain actions without the user having to be logged in.

marshall
Does the Facebook's iPhone API support that?
Mustafa