1.0.13 • Published 6 years ago
react-native-sift-science-k v1.0.13
react-native-sift-science
Getting started
$ npm install react-native-sift-science --save
Mostly automatic installation
$ react-native link react-native-sift-science
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-sift-science
and addSiftScience.xcodeproj
- In XCode, in the project navigator, select your project. Add
libSiftScience.a
to your project'sBuild Phases
➜Link Binary With Libraries
- Run your project (
Cmd+R
)<
IOS - for both manual and automatic linking
- In XCode, in the project navigator, select your project. Add
libSiftScience.a
to your project'sBuild Phases
➜Link Binary With Libraries
pod 'yoga', path: '../node_modules/react-native/ReactCommon/yoga/yoga.podspec' pod 'React', path: '../node_modules/react-native' pod 'SiftScience', path: '../node_modules/react-native-sift-science' pod installpod init ->
- In xcworkspace file -> build phases -> add libSift.a before libSiftScience.a
Android
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.reactlibrary.SiftSciencePackage;
to the imports at the top of the file - Add
new SiftSciencePackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-sift-science' project(':react-native-sift-science').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-sift-science/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-sift-science')
Usage
import SiftScience from 'react-native-sift-science';
// TODO: What to do with the module?
SiftScience;