delba / Permission

A unified API to ask for permissions on iOS
MIT License
2.91k stars 324 forks source link

Fix callback for Location #128

Closed komitake closed 3 years ago

komitake commented 6 years ago

This pull request may resolve https://github.com/delba/Permission/issues/122

didChangeAuthorization is called twice when the CLLocationManager instance is created and authorization status is changed. The mechanism handled by requestedLocation and triggerCallbacks is based on this behavior. So CLLocationManager instance must be created at the time of requesting authorization.

komitake commented 3 years ago

The original issue is that the callback does not get called when selecting Only While Using the App option on iOS 12. However, after iOS 13, the options are changed to Allow While Using App and Allow Once.

Now I can say there are no problems on iOS 13. The callback gets called when selecting both Allow While Using App and Allow Once. So let me close this pull request.