Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Motion & Orientation #12

Open
martdob opened this issue Nov 24, 2019 · 0 comments
Open

Motion & Orientation #12

martdob opened this issue Nov 24, 2019 · 0 comments

Comments

@martdob
Copy link

martdob commented Nov 24, 2019

Since Apple has changes the policy for motion and orientation settings it is necessary to ask the user for the permission. Without the user permission the orientation function will not work.

I would like to suggest to change the controller code with following code on the happyfuntimes server:

buttonEl.addEventlistener('click', function () {
DeviceMotionEvent.requestPermission().then(response => {
if (response == 'granted') {
window.addEventListener('devicemotion', (e) => {
// do something with e
})
}
}).catch(console.error)
});

Many thanks!
Martin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant