W3C home > Mailing lists > Public > public-device-apis-log@w3.org > December 2018

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

From: Reilly Grant via GitHub <sysbot+gh@w3.org>
Date: Thu, 13 Dec 2018 21:27:00 +0000
To: public-device-apis-log@w3.org
Message-ID: <issue_comment.created-447126594-1544736419-sysbot+gh@w3.org>
> 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

This archive was generated by hypermail 2.4.0 : Monday, 4 July 2022 12:47:56 UTC