react-native-datausagecheck
v1.0.0
Published
## Getting started
Downloads
4
Maintainers
Readme
react-native-datausagecheck
Getting started
$ npm install react-native-datausagecheck --save
$ yarn add react-native-datausagecheck
Mostly automatic installation
$ react-native link react-native-datausagecheck
Manual installation
Android
- Open up
android/app/src/main/java/[...]/MainApplication.java
- Add
import com.datausagecheck.RNDatausagecheckPackage;
to the imports at the top of the file - Add
new RNDatausagecheckPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-datausagecheck' project(':react-native-datausagecheck').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-datausagecheck/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-datausagecheck')
Usage
import RNDatausagecheck from 'react-native-datausagecheck';
// TODO: What to do with the module?
RNDatausagecheck.currentTodayDataUsage((msg) => {
console.log(Number(msg))
});