[Webkit-unassigned] [Bug 213966] New: ios safari doesn't call deviceorientation event
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Sat Jul 4 16:39:51 PDT 2020
https://bugs.webkit.org/show_bug.cgi?id=213966
Bug ID: 213966
Summary: ios safari doesn't call deviceorientation event
Product: WebKit
Version: Safari 13
Hardware: Unspecified
OS: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: WebKit Website
Assignee: webkit-unassigned at lists.webkit.org
Reporter: giorgi.lagidze at toptal.com
CC: jond at apple.com
Hi Safari Team...
I am trying to use `deviceorientation` event to be called. The problem is it doesn't get called.
I know that I should request permission to be able to listen to that event.
Here is the code I am using ..
<html>
<button onclick="test()">click here</button>
<script>
function test(){
DeviceOrientationEvent.requestPermission()
.then(response => {
if (response == 'granted') {
console.log("granted good");
window.addEventListener('deviceorientation', (e) => {
// do something with e
console.log("device orientation changed ", e);
})
}
}).catch(err => {
console.log("Err ", err);
})
}
</script>
</html>
It logs `granted good` , but when I change orientation, it never logs the below log nor the error.
To reproduce the above thing, go to https://glagidze.com/index1.html
Questions:
1) Why doesn't it log when orientation changes ?
2) Will this work for below IOS versions (even after requesting permission ? )
3) What other solutions (if this doesn't work) should I provide ? (window.orientation looks like it's working, but it's deprecated).
Thanks in advance..
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20200704/6cd9750b/attachment.htm>
More information about the webkit-unassigned
mailing list