Should the location service indicator (arrow in the status bar) be displayed when using startMonitoringSignificantLocationChanges? - ios

Is it normal to have the 'GPS arrow' in the status bar mentioning that the location service is running when using startMonitoringSignificantLocationChanges ?
Indeed, I don't want this arrow to appear in the status bar when my app is in background (because the user will think that my app reduces its battery life). But I need to track the significant position changes !
Here is the behaviour I have up to now:
My app is in foreground (no arrow displayed in the status bar)
The user clicks on the home button => I execute startMonitoringSignificantLocationChanges when entering in applicationDidEnterBackground delegate method => the arrow appears... (what I don't want!)
Please, tell me if it is normal to have the arrow in the status bar when launching startMonitoringSignificantLocationChanges and if there is a way to remove it.
Thanks !

Yes, it is normal. Your app could be woken by the OS to respond to a significant location change, and that is what the status bar indicator shows. There's a related iOS bug (Richard Groves's answer) at Locationservice Indicator stays "on". I don't know any way to suppress the status bar indication.

Related

Prevent Location blue bar in ios 11

As you already heard, in iOS11, an app that’s actively receiving continuous background updates will show a double-height blue bar, whenever authorization is set to While Using. It seems there is no way to remove the blue bar if the App is using background location App.
My app supports ios 9.0 and above and, I have added all the keys required in info.plist including the one below.
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string></string>
But seems everybody says there is no way to remove the blue bar while background location updates is working.
However I have installed UBER and somehow they managed to hide the blue bar when the app is in background, but in my app I can see blue bar when I put app in background.
Does some one knows any solution to get rid of blue bar in iOS11 when we set permission "while using the app" ?
In iOS 11, the Blue Bar will appear when an Always authorized app opts-in to displaying the blue bar while it is actively receiving Continuous Background Location updates via startUpdatingLocation()
There’s a new property on CLLocationManager that Always authorized apps can use to control the visibility of their blue bar.
#property(assign, nonatomic) BOOL showsBackgroundLocationIndicator
When-in-use authorized apps will continue showing the Blue Bar as before.
No other service will turn on the Blue Bar. When an app which makes use of any other location service receives an occasional update (for example Significant Location Change), the location arrow on the status bar will momentarily blink solid, but the Blue Bar will not appear.
According to apple , After iOS 11 update that blue bar is showing when app is running on the background. What you can do is, track user location when app is in the foreground.
Check this
Try with NSLocationAlwaysUsageDescription in info.plist file and use requestAlwaysAuthorization in CLLocationManager.
showsBackgroundLocationIndicator is useful for requestAlwaysAuthorization.

iOS Location status message on background doesn't show

I've implemented a CLLocation like waze to get the users location on background mode, I want to show the bar like "incall" showing that I'm getting the location.
I don't know why the bar doesn't show, I have in the info.plist this
Key : NSLocationAlwaysUsageDescription.
I assume you are talking about the blue "navigation" bar that appears under the status bar.
That only appears when an app is being used for navigation. An app that simply gets location in the background does not show the blue bar (or any other color bar).
If you requestAlwaysAuthorization the bar will not appear (because you could use location services at any time). The bar appears only when you requestWhenInUseAuthorization and the app asks to keep receiving location updates while in the background.
See the documentation for requestWhenInUseAuthorization (emphasis added):
If the user grants “when-in-use” authorization to your app, your app
can start most (but not all) location services while it is in the
foreground. (Apps cannot use any services that automatically relaunch
the app, such as region monitoring or the significant location change
service.) When started in the foreground, services continue to run in
the background if your app has enabled background location updates in
the Capabilities tab of your Xcode project. Attempts to start location
services while your app is running in the background will fail. The
system displays a location-services indicator in the status bar when
your app moves to the background with active location services.
This line about the "location-services indicator" is notably absent from the documentation for requestAlwaysAuthorization.

iOS8: How to display blue bar "is Using Your Location" with "requestAlwaysAuthorization"

How does an app register for location services in the background and signification change location services, i.e. using requestAlwaysAuthorization, and get the Blue Bar to warn the user that they might want to end their activity?
According to Apple documentation using requestWhenInUseAuthorization:
The system displays a location-services indicator in the status bar when your app moves to the background with active location services.
However,
Apps cannot use any services that automatically relaunch the app, such as region monitoring or the significant location change service.
The limitation on requestWhenInUseAuthorization seems severe (cannot be relaunched if killed by the OS).
Can an app call both the Authorization methods?
Is the app supposed to forgo being relaunched by significant location change services, in order to get the Blue Bar to be seen?
Am I missing something obvious here?
(Similar question is Blue banner "Your app is using your location" is not showing after exiting my app. Other questions seem to want to get rid of the banner.)
The blue bar only show when you enable Background Location Updates and request when-in-use authorization in iOS 8.
Blue bar “is Using Your Location” appears shortly after exiting app
Sounds like location manager can't stop immediately. So the blue bar will appear until location manager stop completely. Or maybe it's just a bug .

Why does my app make the recording (pulsing red) status bar appear when it isn't recording?

My app sometimes uses the microphone, but even when I am not using the microphone, the red status bar appears momentarily when leaving my app.
I have set AVAudioSession's category to SoloAmbient. When I record, I set it to PlayAndRecord, and when I am done I set it back to SoloAmbient. But even when the category is SoloAmbient I still see the red status bar.
Even when my app has not accessed the microphone at all I am still getting this red status bar behavior. I do not have the app configured for background audio. Any ideas what might be making the system think that I am recording?
EDIT: After some experimentation, it looks like I can prevent the app from causing the red status bar on launch by delaying creating of the recording AUGraph until I actually start recording.
However, I still see the red status bar after stopping recording. When I stop recording, I stop the AUGraph and dispose of it and change the AVAudioSession category back to SoloAmbient. But I still see the red status bar when I switch away from the app.
After a long long long long long research and hurdles I found out simple solution for this follow as below
In Targets->General->Deployment Info check the HideStatusBar Option
like below!
And in the ViewController (Which one you kept as RootViewController) in viewDidAppear add this line of code...
[[UIApplication sharedApplication] setStatusBarHidden:NO];
Because when you uncheck HideStatusBar Option and your app needs any background process or audio related process then the status bar will become red with enlarged height. If you dont want status bar in entire app then dont add the above line in viewDidAppear and check HideStatusBar Option.

how to get a handle on the status bar in iOS

I have an audio recording application. And when it is recording in the background, I see a red horizontal bar on the top with my project name on it. I want to get a handle on that bar so that I can display additional things there. How do I get a handle on it and what exactly is that bar called?
If your app is not running in the foreground you don't have access to the screen, so you can't get a handle to the status bar. And even if you could, you wouldn't be able to change it.

Resources