In iOS 7, after my audio interruption listener gets called, any attempt to restore the audio session seems to fail silently.
My interruption listener calls
NSError *activationError = nil;
[[AVAudioSession sharedInstance] setActive:YES error:&activationError];
But the app's audio session is dead as soon as the alarm clock rings. The listener gets called with appropriate begin and end states.
It worked just fine on iOS 6.
I have heard that this is a bug in iOS 7 and that there is a workaround, but can't find it.
Does anyone know a link to a workaround or Technical Note from Apple?
EDIT: I found that I HAVE to use AVAudioSessionCategoryPlayback
instead of kAudioSessionCategory_AmbientSound
. Now it works. But it is not the category I wanted.