title: How to keep iphone screen on in Phonegap 1.0?
body: <p>I'm trying to keep the iphone screen on while my app's running. I followed this post:
  <a href="https://stackoverflow.com/questions/5824072/phonegap-iphone-and-the-big-bad-idletimerdisabled">phonegap, iphone and the big bad idleTimerDisabled</a></p>
  
  <p>and did something like this in PhoneGapDelegate.m:</p>
  
  <pre><code>-(BOOL)application:(UIApplication *)application
          didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  {
    // existing code ...
    application.idleTimerDisabled = YES; // I added this line
    return YES;   // existing code
  }
  </code></pre>
  
  <p>but it didn't work. </p>
  
  <p>I also tried this approach: <a href="http://groups.google.com/group/phonegap/browse_thread/thread/5eeace5c416719ec/d7180ef5a3a9081d?lnk=gst&amp;q=lock#d7180ef5a3a9081d" rel="nofollow noreferrer">http://groups.google.com/group/phonegap/browse_thread/thread/5eeace5c416719ec/d7180ef5a3a9081d?lnk=gst&amp;q=lock#d7180ef5a3a9081d</a>
  but it didn't work either.</p>
  
  <p>Could anybody give me some suggestions? Thank you!</p>
  
  <p>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. </p>