3 ms·
> on iOS, you cannot distinguish if you were granted a permission or not. This isn’t correct. For instance, accessing location services provides CLAuthorizatio
by JimDabell 3y ago
> on iOS, you cannot distinguish if you were granted a permission or not.
This isn’t correct. For instance, accessing location services provides CLAuthorizationStatus:
https://developer.apple.com/documentation/corelocation/clauthorizationstatus https://developer.apple.com/documentation/corelocation/claut...
…and push notifications have UNAuthorizationStatus:
https://developer.apple.com/documentation/usernotifications/unauthorizationstatus https://developer.apple.com/documentation/usernotifications/...
…and health data has HKAuthorizationStatus:
https://developer.apple.com/documentation/healthkit/hkauthorizationstatus https://developer.apple.com/documentation/healthkit/hkauthor...
…and contacts has CNAuthorizationStatus:
https://developer.apple.com/documentation/contacts/cnauthorizationstatus https://developer.apple.com/documentation/contacts/cnauthori...
…and photos has PHAuthorizationStatus:
https://developer.apple.com/documentation/photokit/phauthorizationstatus https://developer.apple.com/documentation/photokit/phauthori...
Photos is a special case because the user has the option of denying access, giving limited access, or giving full access. You can determine if the user has denied access, but you cannot distinguish between limited access and full access.
- ciex 3y agoI recently tried using Sony's (frustrating) Imaging Edge app to transfer photos from a camera to an iPad and gave it limited access and it refused to transfer images! When I changed the permissions to full access it worked. So there must be some difference, maybe not an obvious one.
- atorodius 3y agoNot sure how they do that, but I’d say that on most iPhones in the wild, having the API return <25 images is probably a pretty good indicator that that’s not all pictures.
- epoch_100 3y ago> but you cannot distinguish between limited access and full access I believe you can check whether you received limited photos access: https://developer.apple.com/documentation/photokit/phauthorizationstatus/limited https://developer.apple.com/documentation/photokit/phauthori...
- JimDabell 3y agoSorry, you’re correct. I was thinking of the case where older applications receive PHAuthorizationStatus.authorized when the user has selected restricted. There are newer APIs to handle the restricted access changes.