Re: [deviceorientation] Add API for requesting permission to receive device motion / orientation events (#57)

> I think relying on a Permissions API from another spec would probably work (although, I'd have to see what it looks like first). That said, it would be bit confusing to use Permissions API from another (newer) API and predicate using the (older) API on it.

I believe that use of either API should be predicated on the same permission since they expose the same capability. Having two functions that request the same permission feels like unnecessary bloat but I'm willing to accept that in favor of not confusing developers.

> How about for the 'devicemotion' events, would it be a `LinearAccelerationSensor.requestPermission()` ?

`devicemotion` events should require the `"accelerometer"` and `"gyroscope"` permissions which conveniently is the same as the ones I think should be required for `deviceorientation` events so a single call could provide the necessary permissions for either event type.
 
> Honestly, the fact that the names do not match would be super-confusing IMO.

I don't disagree. It sounds like `navigator.permissions.request()` is not as abandoned as I thought it was. That API feels like a better solution.

> I get that the DeviceOrientation API does not have a global scope object at the moment but it seems like it could have one. Or I actually like the idea of adding static requestPermission() methods to the existing DeviceOrientationEvent / DeviceMotionEvent interfaces.

That seems reasonable if doing this solely through the Permissions Request API is untenable.

-- 
GitHub Notification of comment by reillyeon
Please view or discuss this issue at https://github.com/w3c/deviceorientation/issues/57#issuecomment-447126594 using your GitHub account

Received on Thursday, 13 December 2018 21:27:02 UTC