Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I tell if the iPhone has a passcode?

I'm developing an application that asks for a PIN when you start it. That's not great, but I can live with it. The problem is I'm being asked to ask for the PIN each time the phone wakes from sleep, too. Combined with the OS asking for its passcode, it's too much.

Is there any legitimate way to detect if the phone has a passcode required for waking, so I can skip requiring a PIN in this case? I don't want to know the PIN and I don't actually care if it was locked (for instance, if the phone was asleep very briefly), I just want to know that the data is in some way "protected."

like image 974
Steven Fisher Avatar asked Mar 30 '10 17:03

Steven Fisher


Video Answer


1 Answers

For AppStore or not? If the former, no way.


In 3.x, the passcode is stored on the keychain, that means you have to get into the SpringBoard process to determine whether a passcode exists and nonempty. If you are in SpringBoard, calling -[SBAwayController isPasswordProtected] will determine if the device has passcode.

like image 127
kennytm Avatar answered Oct 14 '22 06:10

kennytm