This package has been deprecated

Author message:

WARNING: This project has been renamed to react-native-shake-event. Install using react-native-shake-event instead.

react-native-shake-event-ios

1.0.3 • Public • Published

react-native-shake-event-ios

npm package react-native channel on discord

Add the shake event on your React Native app, giving to users improved usability. Enjoy!
(works only on real device)

Demo

react-native-shake-event-ios

Install

$ npm install react-native-shake-event-ios --save

Add to Xcode (required)

  1. Add the RNShakeEvent.xcodeproj file to your Xcode project Demo;
  2. Add the Products/libRNShakeEvent.a file to Build Phases Demo.

This step is described here: Linking Libraries.

Usage

import RNShakeEventIOS from 'react-native-shake-event-ios';

class MyComponent extends React.Component {
  componentWillMount() {
    RNShakeEventIOS.addEventListener('shake', () => {      
      console.log('Device shake!');
    });
  }

  componentWillUnmount() {
    RNShakeEventIOS.removeEventListener('shake');
  }
}

API

RNShakeEventIOS

addEventListener('shake', Function)

Start listening the shake event and handle a callback function.

removeEventListener('shake', Function)

Stop to listening the shake event, and is recommended to prevent memory leak.

Issues

  1. Submit here;
  2. iOS only - For Android version please create new module;
  3. On debug mode this event also handle the DevMenu, but works fine on production.

License

MIT © Chessboard Radio Lab

Package Sidebar

Install

npm i react-native-shake-event-ios

Weekly Downloads

0

Version

1.0.3

License

MIT

Last publish

Collaborators

  • jadsonlourenco