I'm trying to get my android app to detect a shake, so the user can return to a previous screen. I have installed react-native-shake and linked the package. My code is below but i'm not sure why it won't pick up a shake. I'm using an android emulator and shaking it through the menu.
I added the console.log just to check for output but it's not printing.
componentDidMount() {
RNShake.addEventListener("ShakeEvent", () => {
//this.props.navigation.navigate("Search")
console.log("SHAKE DETECTED")
})
}
componentWillUnmount() {
RNShake.removeEventListener("ShakeEvent")
}