HI, I want to maintain the session in my iphone application. If the application enter in to background state or application is not active i have to move the user to loging screen. How to do this one?
I saw this example but it is not help me to resolve the issue:
You can follow similar concept. When user logging in put some thing as NSUserDefaults like
[[NSUserDefaults standardUserDefaults] setValue:@"ABCDEFGHIJK" forKey:@"SessionKey"];and in application delegate there is one method called
(void) applicationDidEnterBackground:(UIApplication *)applicationwhich will be called when application is going in background. Just remove that set variable for the sessionkey. And while application is again being launched just check the condition and redirect user to desired screen.
Hope this helps.