bluebar stays forever even if stopupdating is called in iOS 11 - ios

I am accessing location services as 'always', i know all the changes made by apple in iOS 11. i updated my plist as required( added new key). I calling stopUpdatingLocation as soon as application goes to the background, but this blue still stays there saying your application is using location in the background. Top of that filled location icon in status bar changes to outlined location icon also. I am using Mapbox SDK as well. Is it a bug with iOS 11 or am i missing something? Just to give background information, i am fully aware how location services works. i tried almost all solutions to remove that blue bar, but it seems it is not happening.
I tried self.locationManager.allowsBackgroundLocationUpdates = false, self.locationManager = nil, self.locationManager.delegate = nil but nothing is helping.
It will be great if anyone can help me with this.

iOS 11 Beta release 5 has removed the unnecessary and intrusive Blue banner that displays for apps that used the location of the iPhone. Displaying the Blue bar for background location use is left to the app developer through a property.
#property(assign, nonatomic) BOOL showsBackgroundLocationIndicator
The users of the apps with location features are prompted to allow location permission first at the time of installing an app and then periodically prompted for apps that use location in the background continuously. The location use indicator arrow with three different shades is another mechanism for users to know if the location service is in use. Therefore an always appearing blue banner is unnecessary and Apple has recognized it.

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.

Get background location updates (app in background / iPhone locked) with 'whileInUse' Location authorisation

I have a navigation app (iOS 9.3) that can also run in the background (voice guidance and coordinate and speed logging)
So far this only works when users accept the 'always' Location Access. When users change location access to 'While Using' the blue bar appears when back grounded (which is what I want, or at least don't mind) but Location updates stop after about 5 minutes of being backgrounded.
I noticed that Google Maps can do this even when location access is set to 'whileInUse' (blue bar 'Google Maps is using your location' appears when backgrounded) and was wondering exactly how they do it.
Could find some similar questions here on SO, but none that really could answer this.
I'm guessing that it has something to do with enabling 'Background App Refresh' for my app, but not sure... and if that's the solution how exactly would I go about that?

How to hide Location icon in an iOS app on screens that do not require it?

I am developing an iOS app with Xamarin.iOS.
I have granted permissions to use Location Services, and the Location icon is visible in the Status Bar as long as the app is running.
However, my app needs to get the current location on one screen only - the rest of the time location is not needed.
Is it possible to turn off (hide) the Locations icon when app is not really using it?
Answers I found are for old iOS versions or work on jailbroken phones. It is my understanding that Apple is preventing this now. I would appreciate a confirmation if this is at all possible or not. Or if it is possible - some Xamarin / Objective-C /Swift examples would be great.
U mean the airplane ICON in status bar?
This ICON will show when APP using location service, try to stop or remove your location request or mapView, your map SDK have their own interface, like:
locationManager = [[CLLocationManager alloc]init];
[locationManager stopUpdatingLocation];
and be sure other APP not using location service.
but it NOT sure the service will stop immediately, location manager just a monitor to system.
You can use requestAlwaysAuthorization instead of requestWhenInUseAuthorization on CLLocationManager.
NOTE : Provide the related NSLocationAlwaysUsageDescription in the
info.plist file, and then Blue Banner will not display.

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 .

Blue banner '%MyApp% is Using Your Location' for app that uses location services only when active

In my app I'm updating user location every time when app becomes active. I stop CLLocationManager once updated location is received or in applicationWillResignActive:.
In Info.plist there is a NSLocationWhenInUseUsageDescription with appropriate description.
If app is activated and then immediately moved to background, blue banner saying that '%MyApp% is Using Your Location' appears for less then a second. This banner gets hidden as soon applicationWillResignActive: is called.
I've noticed the same problem in Google Maps, but not in Apple Maps.
Is there a way to get rid of this banner completely? Is there anything else I should do to make iOS happy? I do not want it to freak out my users and prevent them from using cool features that require location.
You have probably set location as Background mode in your info.plist. If you remove that, then the blue bar won't appear anymore.
Or, you can use requestAlwaysAuthorization instead of requestWhenInUseAuthorization on CLLocationManager (and provide the related NSLocationAlwaysUsageDescription in the info.plist file), and then it will not appear either.
In my case, my app is using location in the background in some cases, and I would like the blue bar to appear when that is the case. But I do not want it to appear when exiting the app without location in background. As far as I know that is not possible to achieve (I've asked about it here).
EDIT: Note that starting with iOS-9, you can make sure that the blue bar only appears when the user actually wants the app to use the location in the background. See this answer.
If you want to get access to the user's location with CLLocationManager, the app will need to show that banner and the user will need to press "Allow". If they don't do that, your location manager won't be able to detect the user's location.
Apple's Maps is a special case because it's a first party app.

Resources