Posts

Post not yet marked as solved
5 Replies
2.8k Views
I am loading a website with a WKWebView in my Xcode app and the website requires device motion to function. In safari, the website requests access to device motion (ios 13 feature), but in Xcode, it does not request access nor does it begin to track motion data. Using the WebView app on the app store I am able to load in the same website in a WKWebView and the motion is track meaning it is definitely possible. Any help I can get on this feature would be greatly appreciated. Thanks in advance!Here is some more info:ios 13 Device Motion Request JS Code:DeviceMotionEvent.requestPermission() .then(response => { if (response == "granted") { window.addEventListener("devicemotion", e => { console.log(e.acceleration) }); } }) .catch(console.error);Here is a website to demo device motion that works on the WebView app, but not in a basic WKWebView:https://www.audero.it/demo/device-orientation-api-demo.html
Posted
by espeng123.
Last updated
.