Why does my application record the status (pulsing red) status bar when not recording?

My app sometimes uses a microphone, but even when I am not using a microphone, the red status bar appears briefly when I exit my app.

I have set the AVAudioSession category to SoloAmbient. When I record, I set it to PlayAndRecord, and when I'm done, I put it back in SoloAmbient. But even if the category is SoloAmbient, I can still see the red status bar.

Even when my app doesn't have access to the microphone, I still get this red status bar behavior. I do n't have an app set up for background audio. Any ideas that might make the system think I am recording?

EDIT: After some experimentation, it looks like I can prevent the application from invoking the red status bar on startup by delaying the creation of the AUGraph entry until I start recording.

However, I still see the red status bar after stopping recording. When I stop recording, I stop AUGraph and delete it and change the AVAudioSession category back to SoloAmbient. But I still see the red status bar when I switch from the app.

+3


source to share


1 answer


After a long long long long research and barriers I found a simple solution for this as shown below

In Targets-> General-> Deployment Information check the HideStatusBar parameter

as shown below!

enter image description here



And in ViewController (which you saved as RootViewController) in viewDidAppear add this line of code ...

    [[UIApplication sharedApplication] setStatusBarHidden:NO];

      

Because when you uncheck the HideStatusBar Option and your application needs some kind of background process or audio related process, then the status bar will turn red with increased height. If you don't want the status bar to be in the whole application, do not add the above line to viewDidAppear and check the HideStatusBar option.

0


source







All Articles