While working on the permissions sample app I ran into some irregularities:
- The API reference for hasLocationPermissions lists all AUTHORIZATION_* constants as possible values, while only AUTHORIZATION_ALWAYS and AUTHORIZATION_WHEN_IN_USE are valid.
- The API reference for requestLocationPermissions lists all AUTHORIZATION_* constants as possible values, while only AUTHORIZATION_ALWAYS and AUTHORIZATION_WHEN_IN_USE are valid.
- The implementation of requestLocationPermissions seems to call the locationPermissionManager twice if the first statement is false:
- On Android Ti.Calendar.requestCalendarPermissions, Ti.Contacts.requestContactsPermissions and Ti.Media.requestCameraPermissions will call back with success:false if the required permission is missing in tiapp.xml but on iOS Ti.Geolocation.requestLocationPermissions will not call back at all when the required NSLocation*UsageDescription key is missing in tiapp.xml. It should call back with success:false as well.
- If you don't allow permission when asked by Ti.Calendar.requestCalendarPermissions or Ti.Contacts.requestContactsPermissions it will call back with success:false but Ti.Geolocation.requestLocationPermissions does not call back at all.
- For both hasLocationPermissions and requestLocationPermissions wouldn't the expected behaviour be that if AUTHORIZATION_ALWAYS was granted then AUTHORIZATION_WHEN_IN_USE would be seen as granted as well since always > when in use?