Remove Redbar while application is in backgroung and allowing VOIP notification - ios

Red bar is displaying on top of device screen while I am receiving any VOIP notifications. In didReceiveIncomingPushWithPayload method, I am doing nothing no microphone operations, No GPS, no audio session nothing at all just core data operations.
This red bar is indicating VOIP background use but I want to remove this red bar from top of screen without disabling VOIP from build settings.
I don't have any idea how to remove this. Any help would be highly appreciated.

Related

How can I detect lockscreen status to choose between CallKit and LocalNotification for incoming calls?

How to detect phone lockscreen status in a PushKit delegate to choose between notifying the Call to CallKit or using a LocalNotification to notify the user. The aim is to avoid having users actually have to Tap the video button when answering from lockscreen (Because more often then not, test users can't figure it out and get frustrated).
We have a Chat application written in Xamarin that supports audio/video calls over WebRTC.
On iOS incoming calls when the app is in the background or closed are handled using PushKit.
We also implemented CallKit looking to get a more native feel.
But when we receive a call on a locked screen iOS device, after answering CallKit UI stays on top, and we can only move to video call if the user taps the button.
The fact is that CallKit UI answering behavior is inconsistent between Foreground, Background and Locked states, and our users usually can't figure out why they are not getting the App Call UI after answering on locked screen.
We noticed that WhatsApp has worked around the problem by reverting to a visible notification when the screen is locked, and only seems to use CallKit when unlocked, but we can't figure out how to replicate this behavior.
How can we reliably detect Phone lock screen status in our PushKit delegate?
We have tried monitoring screen brightness, but it always gives the same value regardless of state.

In-Call voip status bar in background

We are currently developing an app that uses peer-to-peer audio/voice transfer through APIs. When the app is in the background, a message appears in the in-call status bar reading “XXX (Recording)”. If we remove the in-call status bar altogether the voice goes to mute when the app is in the background. Apparently this message comes from Apple because it doesn’t appear in Android Samsung devices. We would like to change the content and perhaps the color of the in-call status bar in order to remove the word “Recording”. Please refer to attached screen shot. So any advice on the in-call status bar modification? Skype for example has its costume VoIP status bar
Thank you.
You cannot hide or customize the recording bar.
iOS chooses the colors and text of the bar depending on what you are doing:
Recordings are red, which is what you are doing.
Calls are green, which is what Skype is doing.
AirPlay and Personal hotspot are blue.
If you want the same color as Skype try changing your UIBackgroundModes to "voip" (or maybe look if you need to be using CallKit?)
Modifying recording bar (Color-text or anything) is NOT POSSIBLE in ios.
Hiding this when you are using Microphone is also NOT POSSIBLE. This bar appear as long as you use mic. Recoding or not, if mic is in use, It will display this bar. Its security measure for users to know that an app is listening to microphone.

IOS - Add message to status bar

How to add message to status bar when I using geolocations. Like the image below
As #Quentin Hayot described here
This banner is displayed by iOS itself in the following situations:
A background app is tracking your position (after a startUpdatingLocation)
A background app is using your microphone
A background app is performing a VOIP call
The banner color changes with the reason. There is no way to force iOS
to display those banners but by using one of the relevant background
modes.
If your app does not tracking position, using microphone or performing a VOIP call, you will not able to display that bar.

Hide red bar while recording in background

My app keeps listening to voices and analysis them to detect real panic screams. So I want to keep the app running 24/7, but when my app goes in background, the red bar appears on top. Since the recording has to be running for longer period, my app users won't afford to use it anymore. Do you think there is anyway to hide it while recording in background, does Apple has such policy to allow us in such case?
The same question was asked but none is given an answer yet.
I am using AVAudioSession with category AVAudioSessionCategoryPlayAndRecord with options AVAudioSessionCategoryOptionMixWithOthers
Do you think there is anyway to hide it while recording in background
Not "while recording in background". The user needs to know that this is happening.
You can eliminate the red bar — by changing your category and not recording in the background.
But you cannot record in the background without showing the red bar while you are in the background.

iOS - show consistent alert at the top of the UI when backgrounding the app (like personal hotspot does)

I am creating an alarm clock app that requires some user action within the app in order to turn the alarm off. Below is a picture of what another app, Sleep Cycle, does when you turn an alarm on and press the home screen (i.e. background the app).
Here is an image link (I can't post an image yet, no rep despite my many attempts to answer people's questions today) for the effect I want to re-create.
Those that have used iPhone's Personal Hotspot and connected a device will notice that it is the same effect, where a notification appears at the top of the UI - pushing everything down by around 20-40 points. This is highly desirable to an alarm clock app as it encourages the user to keep the app in the foreground so that the app can easily be entered when waking up (instead of relying on the 30 second sound window allowed by local notifications)
Does anyone have any ideas on how to implement this functionality. I assume that it must go somewhere in the:
- (void)applicationDidEnterBackground:(UIApplication *)application
tag within the AppDelegate, but I'm not sure what exactly I need to be reading up on. So if anyone has a link to some relevant Developer Docs that would also be extremely helpful.
Many thanks for your help,
Ryan
There are a handful of built in 'background modes' that change the status bar's appearance depending on what functionality an app provides whilst it's in the background. The one you've identified (a red status bar) is triggered when an app records audio whilst in the background. I presume Sleep Cycle must be acting as though it records audio just for this purpose. Other background modes include VoIP (which I think uses a blue status bar). Check out Apple's documentation on supporting these various background modes
In your case, you'd want to add audio to the UIBackgroundModes property in your Info.plist file.
But note that it wouldn't be unreasonable for Apple to reject an app during review if it pretends to perform one of these background tasks but doesn't. For example, there have been apps in the past that tried playing a silent audio clip continuously in order to stay awake in the background - needless to say Apple got wise to this and the app in question had to change its behaviour.

Resources