Skip to content

Latest commit

 

History

History
executable file
·
71 lines (50 loc) · 1.23 KB

README.md

File metadata and controls

executable file
·
71 lines (50 loc) · 1.23 KB

React Native Sneer

npm version

A react native android module to talk with the Sneer api.

Setup

  • install module
 npm install react-native-sneer --save
  • android/settings.gradle
...
include ':react-native-sneer'
project(':react-native-sneer').projectDir = new File(settingsDir, '../node_modules/react-native-sneer')
  • android/app/build.gradle
...
dependencies {
    ...
    compile project(':react-native-sneer')
}
  • register module (in MainActivity.java)
...
import me.sneer.react.SneerPackage;      // <-------
...

public class MainActivity extends Activity implements DefaultHardwareBackBtnHandler {

 
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ...
    mReactInstanceManager = ReactInstanceManager.builder()
      .setApplication(getApplication())
      ...
      .addPackage(new MainReactPackage())
      .addPackage(new SneerPackage(this))      // <-------
      ...
      .build();

    ...

    setContentView(mReactRootView);
  }

  ...

}

Usage

var Sneer = require('react-native-sneer');
// TODO