Keeping app from going to "sleep"

Discussion in 'iOS Programming' started by jsnuff1, Jul 19, 2008.

  1. macrumors 6502

    Joined:
    Oct 4, 2003
    Location:
    NY
    #1
    The app I am currently creating requires that it always remain active in order for it to function properly. Unfortunatly the OS puts the phone to sleep after a few min of no input by the user, this causes some of the core services to stop communicating with my app untill the user wakes the iphone again.

    Is there anyway to either keep the core services communicating even after the phone goes to sleep, or to keep the phone from going to sleep altogether untill my app is quit?

    Thanks.
     
  2. macrumors 6502

    Joined:
    Mar 31, 2005
    Location:
    London, England
    #2
    I've been wondering exactly the same thing. Does anyone know the answer to this?
     
  3. macrumors newbie

    Joined:
    Feb 8, 2008
    #3
    Not on the official SDK there isn't, if this is an official app you're developing then you'll just have to make it so that if the app does go to sleep it's handled properly.
     
  4. macrumors 6502

    Joined:
    Mar 31, 2005
    Location:
    London, England
    #4
    I'm pretty sure that Pandora keeps playing when the device is in sleep mode.
     
  5. thread starter macrumors 6502

    Joined:
    Oct 4, 2003
    Location:
    NY
    #5
    the AIM app somehow disables auto-lock as well....if i launch AIM and do nothing it wont go to sleep....so there is an official way to do it...just got to find out how.

    Any ideas anyone?
     
  6. macrumors newbie

    Joined:
    Jul 24, 2008
    #6
    Try this

    I read somewhere that the following setting will avoid auto-locking.

    application.idleTimerDisabled = YES.

    Unfortunately, I didn't know about this before submitting the app and I am planning to add it in an update.
     
  7. macrumors newbie

    Joined:
    Aug 7, 2008
    #7
    The next line, is only prevent it goes into sleep mode.

    application.idleTimerDisabled = YES.

    So how does app keep running in the sleep mode ? Like aol radio or Pandora does.
     
  8. macrumors newbie

    fixie rider

    Joined:
    Sep 28, 2008
    #8
    Does apple reject apps that do this?
     
  9. macrumors member

    Joined:
    Jul 9, 2008
    #9
    no they dont

    most of my apps have this

    if the user manually locks the device while using them (without pressing home button)
    they will keep running
     

Share This Page