【发布时间】:2020-01-24 03:18:37
【问题描述】:
我正在尝试在 Cordova 应用程序中使用 W3C device orientation 和设备运动,因为 plugins 现在已弃用。但是window中没有定义DeviceOrientationEvent,添加这个sn-p时也没有触发事件:
window.addEventListener("deviceorientation", function(event) {
// process event.alpha, event.beta and event.gamma
}, true);
以下是我的 Android 设备的一些规格:
Device model: JSN-L23
Cordova version: 8.0.0
Device platform: Android
Device manufacturer: HUAWEI
Device version: 9
WebGL support: true
User agent: Mozilla/5.0 (Linux; Android 9; JSN-L23 Build/HONORJSN-L23; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.132 Mobile Safari/537.36
Android WebView package name: com.google.android.webview
Android WebView version code: 372913600
Android WebView version name: 74.0.3729.136
【问题讨论】:
标签: android cordova devicemotion