Prevent user from locking/sleeping iPhone?

Discussion in 'iOS Programming' started by Matt342, Aug 11, 2008.

  1. Matt342 macrumors regular

    Jul 20, 2007

    Is there any way I can prevent the user from locking (sleeping) an iPhone (so when the user presses the top button nothing happens)?


  2. grimjim macrumors member

    May 24, 2003
    I suspect that this is impossible using the SDK. At least, I hope it is.
    Possibly a silly question, but why would you want to prevent your users from switching off their own phones while running your app? I don't think I'd be happy using an app that did something like that. And I suspect that it wouldn't pass Apple's vetting procedures, either.
  3. mkrishnan Moderator emeritus


    Jan 9, 2004
    Grand Rapids, MI, USA
    Yeah, I have to agree... I would consider this a security violation... I would want Apple to make this impossible in the SDK and/or vet out apps that try to do this.

Share This Page