1.0.28 • Published 6 years ago
react-native-knifern v1.0.28
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
1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]`
2. Go to `node_modules` ➜ `react-native-knifern` and add `RNKnifern.xcodeproj`
3. In XCode, in the project navigator, select your project. Add `libRNKnifern.a` to your project's `Build Phases` ➜ `Link Binary With Libraries`
4. Run your project (`Cmd+R`)<
#### Android
1. 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 the `getPackages()` method
2. 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')
```
3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:
```
compile project(':react-native-knifern')
```
## Usage
```javascript
import RNKnifern from 'react-native-knifern';
// TODO: What to do with the module?
RNKnifern;
1.0.28
6 years ago
1.0.27
6 years ago
1.0.26
6 years ago
1.0.25
6 years ago
1.0.24
6 years ago
1.0.23
6 years ago
1.0.22
6 years ago
1.0.21
6 years ago
1.0.19
6 years ago
1.0.18
6 years ago
1.0.17
6 years ago
1.0.15
6 years ago
1.0.14
6 years ago
1.0.13
6 years ago
1.0.12
6 years ago
1.0.11
6 years ago
1.0.10
6 years ago
1.0.9
6 years ago
1.0.8
6 years ago
1.0.7
6 years ago
1.0.6
6 years ago
1.0.5
6 years ago
1.0.4
6 years ago
1.0.3
6 years ago
1.0.2
6 years ago
1.0.1
6 years ago
1.0.0
6 years ago