views:

90

answers:

1

I (and you) know how to play audio in background.

But my question is like that, some music play apps replace iPod icon which is shown on the first background app page with their icon while they are playing audio in background.

How can I do that?

+1  A: 

We can do it using AudioSession like the following code.

AudioSessionInitialize (
                                    NULL,              // 'NULL' to use the default (main) run loop
                                    NULL,              // 'NULL' to use the default run loop mode
                                    NULL,             // a reference to your interruption callback
                                    NULL              // data to pass to your interruption listener callback
                                    );
UInt32 sessionCategory = kAudioSessionCategory_MediaPlayback;
AudioSessionSetProperty ( kAudioSessionProperty_AudioCategory, sizeof (sessionCategory), &sessionCategory );
AudioSessionSetActive(true);
alones