GithubHelp home page GithubHelp logo

react-native-txocr's Introduction

react-native-txocr

Getting started

$ npm install react-native-txocr --save

Mostly automatic installation

$ react-native link react-native-txocr

Manual installation

##注意 1.github单个上传文件不能超过100M,请到react-native-txocr/ios/WBCloudReflectionFaceVerify/sdks下 将rapidnet_ios.framework.zip解压出来,或者自行下载sdk替换,否则IOS编译时会报错

iOS

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

additional installation(require)

ios

  1. drag react-native-txocr/ios/WBCloudReflectionFaceVerify/bundles/* and react-native-txocr/ios/WBCloudReflectionFaceVerify/sdks/* all sdk and bundles to your project in xcode
  2. open Build PhasesLink Binary With Libraries add UIKit.framework AVFoundation.framework MobileCoreServices.framework CoreVideo.framework Accelerate.framework Security.framework SystemConfiguration.framework CoreMedia.framework AudioToolbox.framework CoreTelephony.framework ImageIO.framework WebKit.framework libc++.tbd and react-native-txocr/ios/WBCloudReflectionFaceVerify/sdks/* all sdk;
  3. Open Build SettingsFramework Search Paths add $(SRCROOT)/../node_modules/react-native-txocr/ios/WBCloudReflectionFaceVerify/sdks

android

  1. Open android/build.gradle
...
allprojects {
    repositories {
        .....
        flatDir {
            dirs project(':react-native-txocr').file('txocrlib')
        }  //ADD THIS
        ....
    }
}
...

Usage

interface Params {
    userId:string,
    nonceStr:string,
    sign:string,
    appId:string,
    orderNo:string,
    version:string,
    license:string,
    name:string,
    idCard:string,
    ip:string,
}
interface Result {
    isSuccess:boolean,
    similarity:string,
    liveRate:string,
    image:string,
}
export default function ocr(params:Params): Promise<Result>

react-native-txocr's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.