dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.07k stars 1.56k forks source link

dart:html's DeviceMotionEvent is missing requestPermission() required for listening to devicemotion events on iOS 13 #41337

Open abegehr opened 4 years ago

abegehr commented 4 years ago

This issue is related to: dart2js

Dart SDK Version (through Flutter):

Flutter 1.15.17 • channel beta • https://github.com/flutter/flutter.git
Framework • revision 2294d75bfa (4 weeks ago) • 2020-03-07 00:28:38 +0900
Engine • revision 5aff311948
Tools • Dart 2.8.0 (build 2.8.0-dev.12.0 9983424a3c)

From iOS 13 onward, web-apps are required to request permissions for listening to device-motion events: https://stackoverflow.com/a/56764762/499113

Permissions for listening to device motion events is requested by calling DeviceMotionEvent.requestPermission()after the user interacted with the web app (ex. on the press of a button).

Dart's DeviceMotionEvent, imported from dart:html, does not implement requestPermission().

Screenshot 2020-04-04 at 17 32 54
Pulkit07 commented 2 years ago

Hi, if someone can guide me, I am happy to fix this. I need this for a project of mine.