tarasikgoga
tarasikgoga

Reputation: 45

NSLocationWhenInUseUsageDescription remove warning application uses geolocation

I created an application in one of view displays the distance from the user to the marker on the map. Ios 8.3 I had to insert the following line info.plist

<key>NSLocationWhenInUseUsageDescription</key>
<string></string>

because without this line application does not start geolocation.But if you minimize the application,top of the screen will be a warning "app "myapp" uses geolocation". How do I remove this warning?

this is my code

self.myLocationManager = [[CLLocationManager alloc] init];
[self.myLocationManager startUpdatingLocation];

[GMSServices provideAPIKey:@"####"];
GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:59.93 longitude:30.35 zoom:9];
mapView_ = [GMSMapView mapWithFrame:CGRectZero camera:camera];
mapView_.settings.compassButton = YES;
mapView_.settings.myLocationButton = YES;
mapView_.myLocationEnabled = true;
//  mapView_.showsUserLocation = YES;
//mapView_.settings.myLocationButton = YES;
mapView_.userInteractionEnabled = YES;
mapView_.frame = CGRectMake(0, 0, 200, 200);
mapView_.center = self.view.center;
[self.scrollView addSubview:mapView_];

UPDATE This is not a screenshot, but looks something like this when I fold the application enter image description here

Upvotes: 0

Views: 751

Answers (2)

Daij-Djan
Daij-Djan

Reputation: 50089

a) don't leave the description empty. that's a hack and may get you rejected. write something sensible

b) you CANT get the bar to disappear IF your app runs in the background and uses location data => you can call stopUpdating and stop all mapviews to make it clear you don't need location data => your user can force-close the app :D

Upvotes: 0

George Grover
George Grover

Reputation: 1134

The blue bar is a new blue status bar for apps that opt to request “When In Use” permission to let them know the app is currently getting continuous location data in the background.

You can read more about it here: http://9to5mac.com/2014/06/04/apple-improves-location-services-in-ios-8-with-when-in-use-mode-visit-monitoring/

You can not get rid of the bar but if you're using When In Use it will vanish after a few seconds.

Upvotes: 2

Related Questions