react-native-knifern

1.0.28 • Public • Published

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 LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-knifern and add RNKnifern.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNKnifern.a to your project's Build PhasesLink 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
  1. 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')
    
  2. 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;

Package Sidebar

Install

npm i react-native-knifern

Weekly Downloads

0

Version

1.0.28

License

none

Unpacked Size

31.5 kB

Total Files

26

Last publish

Collaborators

  • llong