Search code examples
iphoneobjective-cioscocoa-touchipod

Keeping iPod idle and still be able to contact server


When I run my application on iPod touch, I keep my device idle and but programatically, every 30 seconds I make a server call and do some activity (like playing sound).

Now, after some time device sleeps and my application stops contacting server. I want to keep the device active as long as it is talking to server no matter whether a user is interacting with it or not.

How can this be achieved


Solution

  • If you must:

    [UIApplication sharedApplication].idleTimerDisabled = YES;
    

    Stops the screen dimming when your application is running and is in the foreground.