tnrn_sensor

2.0.3 • Public • Published

npm react-native MIT ![bitHound Score][bithound-badge] Downloads

埋点 for React Native.

Support me with a Follow

Getting Started

First, cd to your RN project directory, and install RNMK through rnpm . If you don't have rnpm, you can install RNMK from npm with the command npm i -S tnrn_sensor and link it manually (see below).

iOS

  • #### React Native < 0.29 (Using rnpm)

    rnpm install tnrn_sensor

  • #### React Native >= 0.29 $npm install -S tnrn_sensor

    $react-native link tnrn_sensor

Manually

  1. Add node_modules/tnrn_sensor/ios/RNKitSensor.xcodeproj to your xcode project, usually under the Libraries group
  2. Add libRNKitSensor.a (from Products under RNKitSensor.xcodeproj) to build target's Linked Frameworks and Libraries list
  3. Add tnrn_sensor framework to $(PROJECT_DIR)/Frameworks.

Android

  • #### React Native < 0.29 (Using rnpm)

    rnpm install tnrn_sensor

  • #### React Native >= 0.29 $npm install -S tnrn_sensor

    $react-native link tnrn_sensor

Manually

  1. JDK 7+ is required
  2. Add the following snippet to your android/settings.gradle:
include ':tnrn_sensor'
project(':tnrn_sensor').projectDir = new File(rootProject.projectDir, '../node_modules/tnrn_sensor/android/app')
  1. Declare the dependency in your android/app/build.gradle
dependencies {
    ...
    compile project(':tnrn_sensor')
}
  1. Import import io.rnkit.sensor.SensorPackage; and register it in your MainActivity (or equivalent, RN >= 0.32 MainApplication.java):
@Override
protected List<ReactPackage> getPackages() {
    return Arrays.asList(
            new MainReactPackage(),
            new SensorPackage()
    );
}

Finally, you're good to go, feel free to require tnrn_sensor in your JS files.

Have fun! 🤘

Questions

Feel free to contact me or create an issue

made with ♥

Package Sidebar

Install

npm i tnrn_sensor

Weekly Downloads

8

Version

2.0.3

License

MIT

Unpacked Size

1.13 MB

Total Files

154

Last publish

Collaborators

  • yanyulin
  • kangle
  • winterw
  • jingmeng
  • laopan