PermissionScope
PermissionScope copied to clipboard
Use CMSensorRecorder for statusMotion in iOS9
With Swift3 + XCode8 + iOS10 the MotionPermission() works fine, however when checking for the permission.statusMotion() it always return Unknown even if the permission was accepted... Is that a known issue?
For now I found a workaround by using the new iOS9 CMSensorRecorder feature, that has a very straightforward CMSensorRecorder.isAuthorizedForRecording() -> Bool
that will let us know if MotionPermission was granted.
Maybe worth to add it into PermissionScope?
CMSensorRecorder Reference
Motion status is async iirc. Might be related to how PS' handles async permissions requests (#133)
Could you submit a PR using isAuthorizedForRecording
with availability checking ? (Since it's iOS 9+). The API is ambiguous though, it doesn't differentiate between unknown/unauthorized so we'd have to use the UserDefaults approach
Until 10.3 the CMSensorRecorder workaround was working, but since the iOS 10.3 update it does not seem to work anymore, and return false even if the authorization was given… Any updates on this issue in PermissionScope?
+1