Skip to content
This repository has been archived by the owner on Feb 27, 2019. It is now read-only.

Use CMSensorRecorder for statusMotion in iOS9 #203

Open
jbarmanet opened this issue Oct 5, 2016 · 3 comments
Open

Use CMSensorRecorder for statusMotion in iOS9 #203

jbarmanet opened this issue Oct 5, 2016 · 3 comments

Comments

@jbarmanet
Copy link

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

@jbarmanet jbarmanet changed the title MotionPermission() always return unknown statusMotion() always returns .unknown Oct 5, 2016
@bre7 bre7 added the bug label Oct 11, 2016
@bre7
Copy link
Collaborator

bre7 commented Oct 11, 2016

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

@bre7 bre7 changed the title statusMotion() always returns .unknown Use CMSensorRecorder for statusMotion in iOS9 Oct 11, 2016
@bre7 bre7 added enhancement and removed bug labels Oct 11, 2016
@jbarmanet
Copy link
Author

jbarmanet commented Apr 3, 2017

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?

@nitinalabur
Copy link

+1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants