diff --git a/src/big-vr-play-button.js b/src/big-vr-play-button.js index ecdc1ece..9517b861 100644 --- a/src/big-vr-play-button.js +++ b/src/big-vr-play-button.js @@ -11,7 +11,8 @@ class BigVrPlayButton extends BigPlayButton { handleClick() { // For iOS we need permission for the device orientation data, this will pop up an 'Allow' if not already set // eslint-disable-next-line - if (typeof(window.DeviceMotionEvent) === 'function' && typeof(window.DeviceMotionEvent.requestPermission) === "function") { + if (typeof window.DeviceMotionEvent === 'function' && + typeof window.DeviceMotionEvent.requestPermission === "function") { window.DeviceMotionEvent.requestPermission().then(response => { if (response !== 'granted') { this.log('DeviceMotionEvent permissions not set'); diff --git a/src/plugin.js b/src/plugin.js index 74e4bc88..9c6da1b5 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -804,7 +804,8 @@ void main() { // For iOS we need permission for the device orientation data, this will pop up an 'Allow' // eslint-disable-next-line - if (typeof(window.DeviceMotionEvent) === 'function' && typeof(window.DeviceMotionEvent.requestPermission) === "function") { + if (typeof window.DeviceMotionEvent === 'function' && + typeof window.DeviceMotionEvent.requestPermission === "function") { const self = this; window.DeviceMotionEvent.requestPermission().then(response => {