Name Last Update
android Loading commit data...
ios Loading commit data...
.DS_Store Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
README.md Loading commit data...
index.js Loading commit data...
license Loading commit data...
package.json Loading commit data...

README.md

react-native-fw-rn-aliface

Getting started

$ npm install react-native-fw-rn-aliface --save

Mostly automatic installation

$ react-native link react-native-fw-rn-aliface

Manual installation

iOS

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesfw-rn-aliface and add RNFwRnAliface.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNFwRnAliface.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 com.feewee.aliface.RNFwRnAlifacePackage; to the imports at the top of the file
    • Add new RNFwRnAlifacePackage() to the list returned by the getPackages() method
  2. Append the following lines to android/settings.gradle: include ':react-native-fw-rn-aliface' project(':react-native-fw-rn-aliface').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fw-rn-aliface/android')
  3. Insert the following lines inside the dependencies block in android/app/build.gradle: compile project(':react-native-fw-rn-aliface')

Usage

import RNFwRnAliface from 'react-native-fw-rn-aliface';

// TODO: What to do with the module?
RNFwRnAliface;

构建文档

1.构建项目

https://www.jianshu.com/p/091a68ea1ca7/
https://youngjuning.js.org/2019/06/react-native-create-library%E4%B8%AD%E6%96%87%E6%96%87%E6%A1%A3/
https://www.jianshu.com/p/091a68ea1ca7/

2.修改package.json


{
  "name": "fw-rn-aliface",
  "version": "1.0.0",
  "description": "阿里人脸活体检测",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "npm:publish": "npm --registry https://registry.npmjs.org/ publish",
    "npm:sync": "curl -i https://registry.npmjs.org/fw-rn-aliface",
    "pod:lint": "export LANG=en_US.UTF-8 && pod lib lint TXIm.podspec",
    "pod:install": "cd ios && export LANG=en_US.UTF-8 && pod install"
  },
  "keywords": [
    "aliface"
  ],
  "repository": {
    "type": "git",
    "url": "git@gitlab.feewee.cn:FEV2/fw-rn-aliface.git"
  },
  "homepage": "http://gitlab.feewee.cn/FEV2/fw-rn-aliface",
  "author": "baiyun",
  "license": "MIT",
  "dependencies": {
    "prop-types": "^15.7.2"
  },
  "peerDependencies": {
    "react": "16.9.0",
    "react-native": "0.61.5"
  }
}

####3.修改build.gradle文件

apply plugin: 'com.android.library'
apply plugin: 'maven'
apply plugin: 'signing'

buildscript {
    repositories {
        mavenLocal()
        google()
        jcenter()
        maven() {
            url '/usr/local/node/lib/node_modules/react-native/android'
        }
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.0'
    }
}

repositories {
    mavenLocal()
    google()
    jcenter()
    maven {
        url '/usr/local/node/lib/node_modules/react-native/android'
    }
}


apply plugin: 'com.android.library'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }

    buildTypes {
        release {
            minifyEnabled false
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

signing {
    sign configurations.archives
}

dependencies {
    compileOnly 'com.facebook.react:react-native:+'
    compileOnly files('src/main/assets')
}