-2

In my application I am using CLLocation services in one of my ViewController.
Should I ask user for permission in appdelegate or in that particular ViewController.
If I add permission request code in particular ViewController it will not ask permission until user navigate to that view controller.
Is this correct implementation?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Sangram Shivankar
  • 3,535
  • 3
  • 26
  • 38
  • 1
    You can ask for permission from user in particular view controller. If user denies and you need it to move ahead, show an alert with error and navigate back to previous screen. This would be an ideal approach. – manishsharma93 Jun 28 '19 at 11:18

1 Answers1

0

You should ask the user for permission, when the GPS functionality is actually required, so I would do this in the ViewController and not in the AppDelegate.

inexcitus
  • 2,471
  • 2
  • 26
  • 41