react-native-jump
v3.4.3
Published
Detect jump event on Android
Maintainers
Readme
React Native Shake Event Detector
With this library, you can add shake event detector on your React Native app. Because react-native-shake-event is not in active development anymore, I decided to created this.
Please note that it only works on real devices
Installation
npm install react-native-shakeor
yarn add react-native-shakeLinking the native modules
Automatic:
react-native link react-native-shakeManual (iOS):
- Add the
ios/RNShakeEvent.xcodeprojfile to your Xcode project Demo; - Add the
Products/libRNShakeEvent.afile to Build Phases Demo.
This step is described here: Linking Libraries.
Manual (Android):
react-native link react-native-shakeUsage
import RNShake from 'react-native-shake';
class MyComponent extends React.Component {
componentWillMount() {
RNShake.addEventListener('ShakeEvent', () => {
// Your code...
});
}
componentWillUnmount() {
RNShake.removeEventListener('ShakeEvent');
}
}