I am developing an iPhone app that delivers alerts at certain times using UILocalNotifications
. Pressing the OK button on the alert launches the app so it can perform specific tasks.
So far, everything works beautifully in most cases: if the app is running and the alert fires, it works fine, and if the app is not running (but the phone is on), it works just as well.
However, if the alert fires when the screen is locked, one of two things happens.
- alert fires, and I "slide to unlock" immediately, then the app launches as expected.
- alert fires, but I wait to "slide to unlock" longer than 20 seconds (the time it takes the screen to lock (dim) again). When I finally unlock the screen, the alert shows, but does NOT launch the app.
I have looked throughout the Apple docs and this site, but cannot find an answer. I hope my explanation makes sense. Any thoughts?