Checking from app whether a passcode lock is set for Ipad

Discussion in 'iOS Programming' started by ashwinr87, May 31, 2011.

  1. macrumors member

    Mar 9, 2011

    Since my app would be dealing with sensitive data of the user, I would like to know if there is a way I can check from my app whether there is a Passcode Lock set for the Ipad.

    The reason I need to check this is because say if the user has in the app some information and then keeps it on the table and goes out for a couple of minutes. The ipad/iphone by default, goes to standby mode. If a passcode lock had been set, only when the correct passcode is entered, would anyone be able to use the ipad. This would provide an additional security measure to prevent any passerby to view the sensitive data from the app.

    So basically, I would like my app to check whether the passcode lock is set and if not prompt the user to do it.
    Is this possible and if so, would any one be able to point me in the right direction?
  2. macrumors 65816


    Dec 29, 2010
    Aartselaar // Antwerp // Belgium
    Not if your app is not for Cydia. (jailbroken devices). Because with your own app, you cannot go outside of your sandbox, so you can't check wether the device is locked/passcode etc.
    What u could do, is when your app has been minimalised, or after a certain time (NSTimer), create your own passlock ;)
    Or create a singleton user, and delete it if your minimilised or logged out or whatever. and based upon that u can check wether to show info or not.

    Good luck.
  3. thread starter macrumors member

    Mar 9, 2011
    thanks for the reply...
    I will check it out...


Share This Page