sumon
sumon

Reputation: 742

Customize default current location alert message (iOS)

Is it possible to customize the default alert message when the iPhone wants to use users current location. I want to change not only the text but also the default blue screen alert view. Is it possible ?

enter image description here

Thanks.

Upvotes: 2

Views: 2493

Answers (2)

TimHoelsken
TimHoelsken

Reputation: 21

Years later, Apple did implement some customization options!

Have a look at the documentation documentation

If you put one of the following key in your info.plist (depending on your usage of the location services), you can specify a custom string, that is displayed in the default alert additionally.

  • NSLocationUsageDescription (available since iOS6)
  • NSLocationWhenInUseUsageDescription (since iOS8)
  • NSLocationAlwaysUsageDescription (since iOS8)

Upvotes: 2

Krishnabhadra
Krishnabhadra

Reputation: 34286

Not possible. From documentation,

Important: In addition to hardware not being available, the user has the option of denying an application’s access to location service data. During its initial uses by an application, the Core Location framework prompts the user to confirm that using the location service is acceptable. If the user denies the request, the CLLocationManager object reports an appropriate error to its delegate during future requests. You can also check the application’s explicit authorization status using the authorizationStatus method.

The alert is prompted by Core location framework. We don't have any control over it.

EDIT : To add up, from this Apple developer forum thread (login required)

That alert is shown in a standard fashion for all applications for privacy reasons. The user's current location is sensitive information, and we want to be sure that they give their informed consent to any use of it on the device. The way that we do that is by providing a clear, consistent mechanism for the user to give their consent. If applications were allowed to override or disable the alert, then that consistency would be lost.

and the answerer is an Apple employee..

Upvotes: 6

Related Questions