0

I am new to iOS. Is it possible to show a custom view or dialog in place of the default iOS location permission dialog?

user867662
  • 1,091
  • 4
  • 20
  • 45

2 Answers2

2

No, this dialog is presented by the operating system and you cannot modify it. It is an important part of privacy management that the dialog is presented in a consistent way for all apps and that apps cannot modify the permission process.

You can display a custom view or alert prior to requesting permissions that explains what is happening and the need to click "allow" on the alert that is about to be presented

Paulw11
  • 108,386
  • 14
  • 159
  • 186
0

Direct Answer is it's not possible

explanation :

Only option is set description string by using Cocoa Keys(The keys associated with the Cocoa touch environments)

Add one of these key to

NSLocationWhenInUseUsageDescription NSLocationAlwaysUsageDescription

Info.plist and set it's value to whatever which describe the purpose of getting location

ex:

MyApp picks you up from where you are. To book airport rides, choose “Allow” so the app can find your location.

Important: To protect user privacy, an iOS app linked on or after iOS 10.0, and which accesses the user’s location information, must statically declare the intent to do so. Include the NSLocationAlwaysUsageDescription key in your app’s Info.plist file and provide a purpose string for this key. If your app attempts to access the user’s location information without a corresponding purpose string, your app exits.

If you looking for localization for that message Link

valerybodak
  • 4,195
  • 2
  • 42
  • 53
Alupotha
  • 9,710
  • 4
  • 47
  • 48
  • Thanks for your answer. My question is can we show a custom view/dialog before displaying the location permission dialog. So two dialogs will be appear, 1st one will be the custom one and second one will be iOS permission dialog – user867662 Oct 12 '16 at 22:27
  • 1
    @user867662 Yes I showed you maximum level of the customization which you can do to the iOS permission dialog. – Alupotha Oct 13 '16 at 00:16