Bug 213468 - WKWebView doesn't remember motion permission
Summary: WKWebView doesn't remember motion permission
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: Other
Hardware: iPhone / iPad iOS 13
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-06-22 09:38 PDT by jcesarmobile
Modified: 2021-03-16 11:01 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.