Change text in status bar while app in background - ios

I want to change the text of red bar shown below, how do I do it? I see it when my swift app is currently using the microphone and is in the background.

You cannot change it yourself.
This is a system level event that occurs when your app is running in
background stage and using services like location, audio, etc. This
link discusses about the types of background services an app can
use.

Related

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.

In-call status bar for app

I would like to know if there is a way to make your app show a status bar when the app is performing a specific function. Sort of like Shazam does when Auto Shazam is on, but this might be because the microphone and not something in Shazam's app code but I am wondering if there is a way to programmatically achieve this. Preferably in Swift but Obj-C also works.
This isn't done directly by the app, this is done by the OS when the app is using one of a few features in the background
The bar is red when an app is using the microphone in the background.
The bar is blue when an app is accessing location in the background.
The bar is also blue when a device is connected to the Personal Hotspot.
The bar is green when the telephone (including WhatsApp) is being used.
There may be more colours for other scenarios, but these are the ones I've come across.
I don't know of a way to add this bar on demand.

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.

How To Implement Apparently System-Wide Changes (Status Bar, Dock) in iOS7?

I recently noticed that there are some apps in the iOS app store which claim to be able to change the color of both the status bar and the dock of the iOS Springboard. This seems impossible because such system-wide changes are almost never allowed by Apple, and after some googling I have found no answer. Here is an example of a dock color changing app, and here is an example of a status bar changing app.
Searching SO appears to bring up code for changing the status bar in the app, which is not very difficult, but not outside of the app. However, this functionality has clearly existed for a while, for example in the Voice Memos native iOS app, which turns the status bar red while recording.
Lastly, apps such as voice Memos and the native Music app appear to bring up special controls or animations when in use on the lock screen. It is possible to use the built-in iPod lock screen controls for other music apps, (see here), but I have seen no examples of custom lock screen app controls that made it through the app store.
Sorry to pack so many questions in one, but these are all examples of apparent across-system functionalities which I and likely many others would like to replicate, and thus merit attention.
As a postscript, is it possible that the color changes in dock and status bar are done but changing those parts of the wallpaper extremely so that when seen through the translucent UI they look like less bright but still noticeable colors? Thanks!
All of the examples app you have given just change your background. Since the statusbar and dock are translucent they change color when you set the background made with these app as you background.
The red bar from the voice memos is a system indication that some app is recording, this is not something you can change. The The status bar will become green when you there is an active phone call going and you open any app. The same with tethering.
You can not add any custom lock screen controls, there is no option for this in the SDK.

IOS5 Is it possible to change the text of Double-high status bar?

In IOS SDK, is it possible to change the heading of the Top red status bar(Double high status bar) as referred in the following link.
We are implementing a Voip app and we would like to make that more meaningful than just say "Recording"...
Unfortunately, it's not possible to do this. The double-height status bar is only used for VoIP and audio recording, as well as Personal Hotspot connections.
However, it you're interested in putting custom text in the status bar, then there are many great solutions (the one that I use is https://github.com/myell0w/MTStatusBarOverlay). And the best part is, it's not in violation if Apple's policies! Many apps, including the Gmail app, use this and have been on the App Store for a long time.

Resources