0

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.

Larme
  • 24,190
  • 6
  • 51
  • 81
  • 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 Answers1