currently I'm developing a iPhone app that automatically turns on the light in my room. Therefore my app needs an alarm clock function, which means I have to find a way to trigger an event at a specific time.
In the moment I create UILocalNotification that fires when the alarm time has been reached, so I can handle the event in the didReceiveLocalNotification-method. My problem is that this method is not called when the phone is locked. In this case UILocalNotification only appears on the screen and you have to unlock the device to trigger the event.
There has to be a way to run code even when your phone is locked. I know some alarm clock apps have already found a solution for this problem. The alarm clock app SleepCycle plays a sound even if the app is in background.
So if anyone knows a trick or workaround to solve my problem, I would be very happy about responses.