Bug 213468

Summary: WKWebView doesn't remember motion permission
Product: WebKit Reporter: jcesarmobile <juliosincesar>
Component: New BugsAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: cdumez, dvpdiner2, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: iPhone / iPad   
OS: iOS 13   

Description jcesarmobile 2020-06-22 09:38:04 PDT
Every time you call DeviceMotionEvent.requestPermission() it shows the permission prompt, but it should remember and not show the prompt if it was granted (that's what all the native permissions do)

Sample app https://github.com/jcesarmobile/cordova-requestPermission-issue

run
cordova prepare
open platforms/ios/HelloCordova.xcworkspace
and run from Xcode on any iOS 13 device
click "Access DeviceMotions" and "Allow" on the prompt
run from Xcode again
click "Access DeviceMotions" again

the prompt is shown again, it should't because you already allowed it, DeviceMotionEvent.requestPermission() should just resolve.
Comment 1 Radar WebKit Bug Importer 2020-06-23 17:49:19 PDT
<rdar://problem/64674099>
Comment 2 youenn fablet 2021-01-12 02:13:03 PST
Right, we should expose a delegate that allows application to persistently grant/deny permission.