Respond to events when the device is locked

I am working on a radio alarm and I have some problems. I use local notifications for alarms, so it has a soft rollback if the application does not work.

I am well aware of the limitations of the device, and I know what I can and cannot do when the device is a thing of the past.

But my question is this: I saw other applications launch the audio stream when I locked the device. How is this possible? Could this be in a timeframe?

What is the best way to implement this? Is there any way to activate a streaming session when the device is locked?

Edit

To clarify: I know how I am doing audio recording in the background. But the problem is to start playing the sound when a local notification or some other event appears.

One application that seems to do this is Radio Alarm . I have not tried this for a long period of time. But it seems to be so. Application video demo: http://www.youtube.com/watch?v=KJQiFOcdBWk

+5
source share
1 answer

Have you already announced your background task?

​​ , . , Info.plist. UIBackgroundModes Info.plist , :

audio - . ( AirPlay.)

iOS -

, , "" " " " iOS". "App Plays Audio" .

:

, UIApplication

- (UIBackgroundTaskIdentifier)beginBackgroundTaskWithExpirationHandler:(void (^)(void))handler

: UIApplication

: 21:

NSTimer, . UILocalNotifications , , , , .

, , 14 .

+3

All Articles