Results 1 to 8 of 8

Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.


Thread: Preventing Auto-Lock without user interaction?

  1. #1
    Default Preventing Auto-Lock without user interaction?
    I'm looking for a way to prevent the phone from auto-locking. As is, it requires user interaction to avoid auto-locking. Instead, I'd like the phone/screen to just stay on without user interaction.

    I notice that playing movies will prevent auto-lock and thought about hacking something in, but I'd like to avoid ugly hacks.

    (Copied from below)
    For example: can I throw simulated touch events to the system to make the phone think someone touched the screen? Or disable the auto-locking through a system preference API?

    Any ideas?

    Thanks!
    Last edited by sinr; 2008-08-08 at 11:38 PM.

  2. #2
    Livin the iPhone Life redcard's Avatar
    Join Date
    Oct 2007
    Location
    Scotchland
    Posts
    2,141
    Thanks
    8
    Thanked 204 Times in 184 Posts

    Uhhh, set auto-lock to 'never'?
    To live, you have to lie

  3. #3
    Livin the iPhone Life Eurisko's Avatar
    Join Date
    Aug 2007
    Location
    Toronto, Canada
    Posts
    3,307
    Thanks
    12
    Thanked 562 Times in 483 Posts

    What he said
    Get "iPod & iTunes for Dummies", it'll change your life.

  4. #4
    yeah, what they said

  5. #5

  6. #6
    Quote Originally Posted by redcard View Post
    Uhhh, set auto-lock to 'never'?
    Crap, I wasn't specific enough :-( Sorry everyone.

    I meant how to prevent the phone from auto-locking programmatically (via the toolchain or SDK). For example: can I throw simulated touch events to the system to make the phone think someone touched the screen? Or disable the auto-locking through a system preference API?

    Can this be moved back to the iPhone/iPod Development forum?

    Thanks!

  7. #7

  8. #8
    Green Apple
    Join Date
    Jun 2008
    Location
    Depends on the day
    Posts
    56
    Thanks
    3
    Thanked 3 Times in 3 Posts

    You should just have to set the auto lock to never. If that doesn't work, go into the Prefrences.app bundle and you have to edit on of the plists. On the plist you set all times related to auto lock to -1. You can also add different times to set the auto lock to and different choices in Settings>General>Auto-Lock i.e. 30 seconds, 20 min, an hour... This is the best plist file I have ever messed with because you dont have to change the code to accomplish your goal.

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •