I’m writing an App that involves authentication on the initial screen, and allows access to sensitive data on later screens. When the iPhone is locked, either with the lock button or through auto-lock, I would like the App to close itself as a security measure. Is there a way I can do this?
I’m writing an App that involves authentication on the initial screen, and allows access
Share
Your UIApplicationDelegate will receive the
message when the screen locks, and
when it comes back. However, it could also receive these messages in other situations (such as receiving a phone call, the user closes the app on iOS 4.0 and later) and I don’t know of a way of distinguishing the reason.
A better user experience in my opinion would be to pop up the authentication again when the app comes back. This way the user won’t be confused when the phone unlocks, and the app they had running has mysteriously quit.