How do I keep my user still logged in after they have quit the app or restart their phone (I used Facebbok account by the way)? I know this might have been answered before but I haven't found it yet.
Asked
Active
Viewed 906 times
0
-
do you wants user to keep login for facebook or for your app? – Mohit Aug 08 '14 at 09:16
-
You can maybe store the authenticaiton credential in NSUserDefaults or if you're using OAuthentication, there's an AFNetworking [AFOAuthenticationCredential storeCredential: withIdentifier:]; method that stores it for you. On app relaunch, perhaps you could check for the credential in the NSUserDefaults or using [AFOAuthenticationCredential retrieveCredentialWithIdentifier:]; method if you're using OAuth with Facebook. – Zhang Aug 08 '14 at 09:22
-
I want to keep the user logged-in in my app – user3602513 Aug 08 '14 at 09:26
-
Then use NSUserDefaults. it would be best option – Mohit Aug 08 '14 at 09:27
-
http://stackoverflow.com/questions/6972092/ios-how-to-store-username-password-within-an-app – Mohit Aug 08 '14 at 09:30
1 Answers
0
You can store the user credentials securely by using the iOS Keychain https://developer.apple.com/library/ios/documentation/Security/Conceptual/keychainServConcepts/iPhoneTasks/iPhoneTasks.html#//apple_ref/doc/uid/TP30000897-CH208-SW3

TenD
- 43
- 4