Twitter and Facebook on iPhone - save sessions across app launches? - iphone

I am using OAuth for twitter and fb-connect for facebook authentication in my iPhone app. Is it possible to save the user sessions across app launches?
i.e. if the user logs in once, the next time they launch the app, we log them in automatically from some state saved the last time the app closed?
For Twitter would it work if I just save the auth_token and use it every time the user wants to use twitter from my app? Or do I need to do anything else? I could not get it to work like that so wondering if I was doing something wrong.
Thanks.

For Twitter you will need to save the access_token. This is unique to the user/application and when saved will let you act as the users for future requests. It will consist of two strings one of which will start with the user's id.

Related

how to post on facebook user's profile every time user logs in?

i'm a newbie to facebook app. development. As part of my term project i have to design an app.
i want to make a call to method 'feed dialogue' or want to post on user's wall, every time user logs in to his account.. which means i want to trigger my app. automatically every time user logs in........ or can my app. be triggered automatically every time user post some thing ??..... should i make my app. run in background.... or what should i do..??
give me some references or anything...
Thank you

Facebook: detecting user apps

Hello I've read the docs and am having trouble getting a definitive answer for the following questions:
Can our app detect if another app is used by a given user. What about if we are admin of, or have the id of both apps.
If one of the apps is removed from FB is there a way to tell if a user had it installed before it was removed? A sort of history of past apps, I guess.
Here:
FB Connect: is there a way to see the logged in user's facebook apps?
Best answer is "I think the most you can do..." but I'd like to know for sure.
Thanks for any help.
If you request the permission user_actions:APP_NAMESPACE you can see the open graph actions that the user has performed in that app.
http://developers.facebook.com/docs/authentication/permissions/#open_graph_perms
In my apps I generally store the user ID of all authorized users in a database, and when I get a call via the "Deauthorize Callback URL" I don't delete the user from the database, but instead only flag the user as deauthorized.
This way I can easily get an overview of users that are using (or have used) any of my apps. This allows me to present special features for users who are using several of my apps.
For example, let's say I made a photo app (like Instagram) and a GPS running app (like Endomondo). If the user takes a photo with Instagram while running with Endomondo, I could present the option to GPS-tag the photo, or add the photo to Endomondo.
This is something that I think we developers should use more. Perhaps present an open API to other apps, to let the apps work together.

How to check user is using my application facebook

I want check how to know user is using my application facebook
Example: One user go to application page, i set user online, when user close application page, i set user offline
Thanks.
If you haven't heard from a user for some time, chances are that he closed a page with your app.
Memorize last time a user did anything in your app, and set a timeout. If N minutes later there are no new actions, you mark him offline.

how can I see a list of everyone who is using my iPhone app?

I incorporated the new facebook sdk into my iPhone/iPad app update which just went live yesterday. Per iTunes connect 1100 people have already updated. My insights on FB are behind which I understand. However, when I go to my app's FB page it shows some of my friends using my app (not "liking" it, but using it). How can I get a list of ALL my friends using it, and of EVERYONE using it?
Thanks!
There is no way to get a full listing of your app's users - you'd need to store this in your own database. You can check if any particular user has authorised your app with a call to /[UID]?fields=installed in the Graph API using your app's access token or a user access token
As far as I know, you can't (for privacy reasons, I'm sure).
I have seen people trying, though: How to get all the user IDs of people who are using your Facebook application

Wordpress Background (Mobile) Web Authentication

I'm building an iPhone app that, in part, allows the user to log in to, pull data, and post data back to a Wordpress site (more specifically, Buddypress). One way I'm considering approaching this problem is to use a series of UIWebViews to display the mobile-themed version of the site.
Ideally, I want the user to be able to, upon first-launch of the app, input their username and password, and then never have to do it again (functionally similar to tons of other social apps out there, like Facebook, Twitter, etc.)
Here's my question - obviously it is easy to store the user's login credentials, but how do I, in the background, establish an authenticated and persistant session with those credentials each time the app opens, so for the user, they are never presented with a login screen again, and can just use the app like normal?
Does anybody have any suggestions?
WordPress uses XMLRPC to authenticate. You can, on top of the API given, write your own codes to store credentials. Persistent session can then be made.
Read this FAQ : XML-RPC Support for WordPress