react-native-knifern
v1.0.28
Published
1.0.28 更新网络缓存,更新README
Maintainers
Readme
react-native-knifern
最新版说明
1.0.28 更新网络缓存,更新README
结构说明
包
`import {Config, logger, Storage, Network, Token, SQLite} from "react-native-knifern"`开始
$ npm install react-native-knifern --save
Mostly automatic installation
$ react-native link react-native-knifern
设置说明
`App.js`
```
import {Config, logger, Storage, Network, Token, SQLite} from "react-native-knifern"
Config.appName = "某APP";
Config.baseHost = "https://www.yupute.cn";
Config.isDebug = true; //是否开启全局Debug日志
Config.baseDomain = "__knife_rn"; //关键作用域名,主要用于一些关键性键值、文件等,如SQLite数据库
```iOS
- In XCode, in the project navigator, right click
Libraries➜Add Files to [your project's name] - Go to
node_modules➜react-native-knifernand addRNKnifern.xcodeproj - In XCode, in the project navigator, select your project. Add
libRNKnifern.ato your project'sBuild Phases➜Link Binary With Libraries - Run your project (
Cmd+R)<
Android
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import cn.yupute.knife.rn.RNKnifernPackage;to the imports at the top of the file - Add
new RNKnifernPackage()to the list returned by thegetPackages()method
- Append the following lines to
android/settings.gradle:include ':react-native-knifern' project(':react-native-knifern').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-knifern/android') - Insert the following lines inside the dependencies block in
android/app/build.gradle:compile project(':react-native-knifern')
Usage
import RNKnifern from 'react-native-knifern';
// TODO: What to do with the module?
RNKnifern;