How can I change text "App would like to use your current location?"
Asked Answered
S

1

6

Can we change this text?

I have used property purpose of CLLocationManager class. But message did not change.

[locationManager setPurpose:@"Change text message"];

Any ideas?

Thanks,

Sackey answered 17/12, 2012 at 10:47 Comment(0)
U
12

Add a key in your info.plist like: NSLocationUsageDescription and add your string as it's value.

iOS 8 and greater

They introduced two more keys other than NSLocationUsageDescription

  1. NSLocationAlwaysUsageDescription
  2. NSLocationWhenInUseUsageDescription

iOS 6 or greater

NSLocationUsageDescription

“Privacy - Location Usage Description”

Specifies the reason for accessing the user’s location information. See “NSLocationUsageDescription” for details.

iOS 6.0 and later

Check this link for reference

iOS 3.2 to iOS 5

purpose

An application-provided string that describes the reason for using location services. (Deprecated in iOS 6.0.)

@property(copy, nonatomic) NSString *purpose Discussion

If this property is not nil and the system needs to ask for the user’s consent to use location services, it displays the provided string. You can use this string to explain why your application is using location services.

You must set the value of this property prior to starting any location services. Because the string is ultimately displayed to the user, you should always load it from a localized strings file.

Availability

Available in iOS 3.2 and later.
Deprecated in iOS 6.0.

Declared In CLLocationManager.h

Unearned answered 17/12, 2012 at 10:49 Comment(5)
Is is legal? Will apple approve?Sackey
@SangamAngre: I found this key from their documentation. So I think they won't reject.Unearned
I am developing app for version 5.1 and later.Sackey
I tried to setup purpose as [locationManager setPurpose:@"Change text message"]; but text message does not changeSackey
Have you read the title of question "How can I change text “App would like to use your current location?”" He want to change this text, not want to add some text below it.Lapidify

© 2022 - 2024 — McMap. All rights reserved.