Forcing location allowance on iPhone
If using CLLocationManager in your app, the first time a location update is made it will pop a question to the user asking for permission to use the location service.
Now my app uses location, but not in the beginning of the app life cycle and when the user is not active with the phone. So I figure I have to get the allowance right from start. I don't think there is a way to "force" the question. How would you sug开发者_如何转开发gest me to do this?
Go ahead and attempt to access location information on launch by starting and stopping location updates. This is equivalent to "forcing" the question.
精彩评论