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

onShake() not working on Android 12 #39

Open
CheeseMistress opened this issue Nov 21, 2021 · 2 comments
Open

onShake() not working on Android 12 #39

CheeseMistress opened this issue Nov 21, 2021 · 2 comments

Comments

@CheeseMistress
Copy link

Tested my code on Nexus 6P running on Android 8.x.x, and shake triggers perfectly. On my Google Pixel 3XL running on Android 12, onShake event is not triggered. Shake functionality is verified to be working on the Pixel (tested through another app).

`var shakeNode;

document.addEventListener("deviceready", onDeviceReady, false);

function onDeviceReady() {
shakeNode = document.getElementById('shakeId');
if (typeof shake !== 'undefined') {
shakeNode.innerHTML = "ready!"
shake.startWatch(onShake, 30, onShakeError);
}
}

var onShake = function() {
alert("Shake triggered.");
}

var onShakeError = function () {
alert("ShakeError occurred.")
}`

@monkeywithoutthee
Copy link

does it give any errors?

@markalston
Copy link

@CheeseMistress Did you ever get this solved? I am able to get it working on Android 12 but not on Android 14. No errors or messages of any kind. I think it is due to using the device-motion plugin which is depreciated.

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

3 participants