I want to implement mobile device "shake" event both for Android and iOS platforms on my webpage.
So, I immediately found one and only script written by Alex Gibson.
After some tests I found out that it works on Android phone perfectly. On iPhone it doesn't work unfortunately.
According to MDN web docs it's nothing wrong with the script which uses devicemotion
event.
This script on codeopen with no errors for iOS, just not working.
Is there any approach to overcome this issue?
U.P.D.
I found this article describing requirements for iOS 13 for devicemotion
event, so now you have to request permission for it.
But it also doesn't work.
window.DeviceMotionEvent.requestPermission()
.then(response => {
console.log(response);
}
})
It returns 'denied' status anyway without any permission request.