I'm trying to keep the iphone screen on while my app's running. I followed this post: phonegap, iphone and the big bad idleTimerDisabled
and did something like this in PhoneGapDelegate.m:
-(BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// existing code ...
application.idleTimerDisabled = YES; // I added this line
return YES; // existing code
}
but it didn't work.
I also tried this approach: http://groups.google.com/group/phonegap/browse_thread/thread/5eeace5c416719ec/d7180ef5a3a9081d?lnk=gst&q=lock#d7180ef5a3a9081d but it didn't work either.
Could anybody give me some suggestions? Thank you!
UPDATE: Thank you all! It turns out I was changing the wrong fil(PhoneGapDelegate.m). applicationdidfinishlaunching method in that file is never invoked. The file to be changed is AppDlegate.m.