W3C home > Mailing lists > Public > public-device-apis-log@w3.org > January 2019

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

From: Reilly Grant via GitHub <sysbot+gh@w3.org>
Date: Tue, 29 Jan 2019 21:22:05 +0000
To: public-device-apis-log@w3.org
Message-ID: <issue_comment.created-458711949-1548796924-sysbot+gh@w3.org>
@anssiko, I am positive on this. Blink's implementation will start as a no-op that immediately resolves with `"granted"` but I agree that it is important for it to be present nonetheless.

@cdumez, can you put together a draft of this change in a PR so we can discuss the specifics on how this will be specified? From the preceding discussion it sounds like we have settled on extending the `DeviceOrientationEvent` and `DeviceMotionEvent` interfaces with something like,

```
enum PermissionState {
  "granted",
  "denied",
};

[Exposed=(Window)]
interface DeviceOrientationEvent {
  static Promise<PermissionState> requestPermission();
};

[Exposed=(Window)]
interface DeviceMotionEvent {
  static Promise<PermissionState> requestPermission();
};
```

These are a specialization of the so-far unspecified `requestPermission()` method that should be added to the Generic Sensor API that will likely have parameters to control things like requested sampling frequency.

-- 
GitHub Notification of comment by reillyeon
Please view or discuss this issue at https://github.com/w3c/deviceorientation/issues/57#issuecomment-458711949 using your GitHub account
Received on Tuesday, 29 January 2019 21:22:06 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:34:27 UTC