question

balajitirumala-9392 avatar image
0 Votes"
balajitirumala-9392 asked LeonLu-MSFT commented

Disappearing Wi-fi bar in Xamarin iOS app

We have requirement in our project that we need to activate or deactivate audio in some of the screens and whenever we deactivate audio, we are facing problem like iPhone status bar is refreshing and some time icons in status bar like WIFI, battery and signal icons are disappearing and appearing after sometime or when we navigate through different screens in the app.

Note: We have enabled one of the background mode setting called “Audio, AirPlay and Picture in Picture” in Info.plist. If we disabled above setting called “Audio, AirPlay and Picture in Picture” in Info.plist, we are not getting above problem like refreshing of status bar and disappearing of WIFI and other icons.

Can any one please help us to resolve above issue without disabling the “Audio, AirPlay and Picture in Picture” in Info.plist

I have tried below code to deactivate audio using AVAudioSession in Xamarin.IOs but didn't work

var session = AVAudioSession.SharedInstance(); session.SetCategory(AVAudioSessionCategory.Playback); session.SetActive(false);

dotnet-xamarin
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

LeonLu-MSFT avatar image
0 Votes"
LeonLu-MSFT answered LeonLu-MSFT commented

Hello,​

Welcome to our Microsoft Q&A platform!

You can try to use following two ways to keep status bar.

1. Info.plist Setting

In the Info.plist, ensure that Status bar is initially hidden is No

103628-image.png

2. StatusBarHidden Property

Search the code to find any references to UIApplication.SharedApplication.StatusBarHidden and ensure that it is false
103629-image.png

Best Regards,

Leon Lu



If the response is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



image.png (121.8 KiB)
image.png (179.2 KiB)
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.


@balajitirumala-9392 May I know if you have got any chance to check my answer? I am glad to help if you have any other questions.

0 Votes 0 ·

Hey thank you for your response! I'll try this and update here if it worked.

0 Votes 0 ·

Ok, waiting for you update.

0 Votes 0 ·