Reputation: 6253
I have making an application in Swift, and I use location, pictures... But this ask the permissions when I open the view of location and when I open the other views. And I want ask all permissions at the first time..
How can I ask all the permissions when I open app first time? Is this possible?
Upvotes: 2
Views: 2336
Reputation: 125007
How can I ask all the permissions when I open app first time? Is this possible?
iOS will present the permission dialog when you start using location services. If you want to make sure that dialog comes up when the app is launched instead of when the user navigates to some view, just start using location services when the app starts up. For example, you could call CLLocationManager's -startUpdatingLocation
method when the app starts. I don't think that's a great idea -- the user shouldn't have to give permission until the app actually needs the location, and starting location updates early will use power unnecessarily -- but it should accomplish what you're asking for.
Upvotes: 2