react-native-sweepr-modules
v1.3.0-beta.88
Published
TODO
Downloads
153
Readme
react-native-sweepr-modules
Getting started
$ npm install react-native-sweepr-modules --save
Mostly automatic installation
$ react-native link react-native-sweepr-modules
Manual installation
iOS
- In XCode, in the project navigator, right click
Libraries
➜Add Files to [your project's name]
- Go to
node_modules
➜react-native-sweepr-modules
and addSweeprModules.xcodeproj
- In XCode, in the project navigator, select your project. Add
libSweeprModules.a
to your project'sBuild Phases
➜Link Binary With Libraries
- Run your project (
Cmd+R
)<
Android
- Open up
android/app/src/main/java/[...]/MainApplication.java
- Add
new SweeprCloudPackage(), new SweeprScanPackage(), new SweeprTestPackage(), new SweeprResolutionPackage(), new PingTestPackage()
to the list returned by thegetPackages()
method - Use autoimport from android studio for get that packages automatically.
- Append the following lines to
android/settings.gradle
:include ':react-native-sweepr-modules' project(':react-native-sweepr-modules').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-sweepr-modules/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-sweepr-modules')
Usage
import { NativeModules } from "react-native";
// TODO: What to do with the module?
const speedTest = NativeModules.SpeedTest;
const pingTest = NativeModules.PingTest;
const sweeprCloud = NativeModules.SweeprCloud;
const sweeprScan = NativeModules.SweeprScan;