tags:

views:

21

answers:

1

hello all, I have tried several forums but still unable to get the answer.. I am developing an application which does radio streaming in iPhone 4.0

Now i want that the audio of the radio must continue even after the application is in suspended state..

Also i have an .m3u file which contains 3 urls of .mp3 So i also want that if one mp3 file finishes in suspending state it must continue with another. I have done the code when application is in foreground but confused how to do this when application is in background state..

Please help

A: 

This is wht i have used and worked for me..

UIBackgroundTaskIdentifier backgroundTask = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^{
            /* just fail if this happens. */
            NSLog(@"BackgroundTask Expiration Handler is called");
            [[UIApplication sharedApplication] endBackgroundTask:backgroundTask];
        }];

hAPPY cODING...

Suriya