v151 · sensors · permissions
DeviceOrientation Events Permission Request API
DeviceMotionEvent.requestPermission() and DeviceOrientationEvent.requestPermission() return a promise resolving to "granted" or "denied" — a user-gesture-triggered permission flow for sensor access.
concepts
Permission Flow
Click a button to call
requestPermission(). See the returned state — granted, denied, or not available on this device.Live Sensor Data
After permission is granted, read live
deviceorientationanddevicemotionevents and display alpha/beta/gamma values in real time.