I have made an iphone fitness application. The issue i am unable to resolve here is that, while the application is running, the iphone goes in the sleep mode, and hence the accelerometer and sound turns off. Which i dont want to happen.
Is there anyway i can avoid this from happening? If not that, atleast i could increase the time of my iphone to go into sleep mode.
Regards Zeeshan
Turn off all sleep schedules and alarmsTap Browse at the bottom right, then tap Sleep. Scroll down to Your Schedule. Tap Full Schedule & Options, then turn off Sleep Schedule (at the top of the screen). You can turn them all on again later.
When people say their iPhone goes to sleep, what they really mean is it enters auto-lock mode after a set time of inactivity. This inactivity is when you don't tap the screen in a certain amount of time. Auto-lock mode is usually set to engage after 2 minutes of inactivity, but this can vary.
Try this
[[UIApplication sharedApplication] setIdleTimerDisabled:YES];
As Jacob and epatel said, the [[ UIApplication sharedApplication ] setIdleTimerDisabled: YES ];
is the way you wanted. However, you'd better to implement when the application is interrupted by other signal. It means that you'd implement - (void)applicationWillResignActive:(UIApplication *)application
method.
Because, there are enforced interruption on the iPhone/iPod touch. A phone call, push a power button, and so on.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With