{"id":18339861,"url":"https://github.com/rnkit/rnkit-excard","last_synced_at":"2025-07-27T13:17:44.394Z","repository":{"id":135844608,"uuid":"90875279","full_name":"rnkit/rnkit-excard","owner":"rnkit","description":"易道博识-图像识别 for ReactNative","archived":false,"fork":false,"pushed_at":"2017-08-21T05:02:38.000Z","size":163,"stargazers_count":17,"open_issues_count":1,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-21T18:11:12.791Z","etag":null,"topics":["excard","react","react-native","react-native-ocr","rnkit"],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rnkit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-05-10T14:44:20.000Z","updated_at":"2022-11-02T09:04:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"f3acf42f-1264-47c4-b00e-727478459d03","html_url":"https://github.com/rnkit/rnkit-excard","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rnkit%2Frnkit-excard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rnkit%2Frnkit-excard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rnkit%2Frnkit-excard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rnkit%2Frnkit-excard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rnkit","download_url":"https://codeload.github.com/rnkit/rnkit-excard/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247440613,"owners_count":20939223,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["excard","react","react-native","react-native-ocr","rnkit"],"created_at":"2024-11-05T20:19:39.579Z","updated_at":"2025-04-06T05:32:21.476Z","avatar_url":"https://github.com/rnkit.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm][npm-badge]][npm]\n[![react-native][rn-badge]][rn]\n[![MIT][license-badge]][license]\n[![bitHound Score][bithound-badge]][bithound]\n[![Downloads](https://img.shields.io/npm/dm/rnkit-excard.svg)](https://www.npmjs.com/package/rnkit-excard)\n\n易道博识-图像识别 for [React Native][rn].\n\n[**Support me with a Follow**](https://github.com/simman/followers)\n\n[npm-badge]: https://img.shields.io/npm/v/rnkit-excard.svg\n[npm]: https://www.npmjs.com/package/rnkit-excard\n[rn-badge]: https://img.shields.io/badge/react--native-v0.40-05A5D1.svg\n[rn]: https://facebook.github.io/react-native\n[license-badge]: https://img.shields.io/dub/l/vibe-d.svg\n[license]: https://raw.githubusercontent.com/rnkit/rnkit-excard/master/LICENSE\n[bithound-badge]: https://www.bithound.io/github/rnkit/rnkit-excard/badges/score.svg\n[bithound]: https://www.bithound.io/github/rnkit/rnkit-excard\n\n## Getting Started\n\nFirst, `cd` to your RN project directory, and install RNMK through [rnpm](https://github.com/rnpm/rnpm) . If you don't have rnpm, you can install RNMK from npm with the command `npm i -S rnkit-excard` and link it manually (see below).\n\n### iOS\n\n* #### React Native \u003c 0.29 (Using rnpm)\n\n  `rnpm install rnkit-excard`\n\n* #### React Native \u003e= 0.29\n  `$npm install -S rnkit-excard`\n\n  `$react-native link rnkit-excard`\n\n#### Manually\n1. Add `node_modules/rnkit-excard/ios/RNKitExcard.xcodeproj` to your xcode project, usually under the `Libraries` group\n1. Add `libRNKitExcard.a` (from `Products` under `RNKitExcard.xcodeproj`) to build target's `Linked Frameworks and Libraries` list\n1. Add ocr framework to `$(PROJECT_DIR)/Frameworks.`\n\n### Android\n\n* #### React Native \u003c 0.29 (Using rnpm)\n\n  `rnpm install rnkit-excard`\n\n* #### React Native \u003e= 0.29\n  `$npm install -S rnkit-excard`\n\n  `$react-native link rnkit-excard`\n\n#### Manually\n1. JDK 7+ is required\n1. Add the following snippet to your `android/settings.gradle`:\n\n  ```gradle\ninclude ':rnkit-excard'\nproject(':rnkit-excard').projectDir = new File(rootProject.projectDir, '../node_modules/rnkit-excard/android/app')\n  ```\n  \n1. Declare the dependency in your `android/app/build.gradle`\n  \n  ```gradle\n  dependencies {\n      ...\n      compile project(':rnkit-excard')\n  }\n  ```\n  \n1. Import `import io.rnkit.excard.EXOCRPackage;` and register it in your `MainActivity` (or equivalent, RN \u003e= 0.32 MainApplication.java):\n\n  ```java\n  @Override\n  protected List\u003cReactPackage\u003e getPackages() {\n      return Arrays.asList(\n              new MainReactPackage(),\n              new EXOCRPackage()\n      );\n  }\n  ```\n1. Add Module `ExBankCardSDK` And `ExCardSDK` In Your Main Project.\n\nFinally, you're good to go, feel free to require `rnkit-excard` in your JS files.\n\nHave fun! :metal:\n\n## Basic Usage\n\nImport library\n\n```\nimport RNKitExcard from 'rnkit-excard';\n```\n\n### Init\n\n```jsx\nRNKitExcard.config({\n  DisplayLogo: false\n  ....\n})\n```\n\n#### Init Params\n\n| Key | Type | Default | Description |\n| --- | --- | --- | --- |\n| OrientationMask | string | 'MaskAll' | 方向设置，设置扫描页面支持的识别方向 |\n| ByPresent | BOOL | NO | 扫描页面调用方式设置,是否以present方式调用，默认为NO，YES-以present方式调用，NO-以sdk默认方式调用(push或present) |\n| NumberOfSpace | BOOL | YES | 结果设置，银行卡号是否包含空格 |\n| DisplayLogo | BOOL | YES | 是否显示logo |\n| EnablePhotoRec | BOOL | YES | EnablePhotoRec |\n| FrameColor | int |  | 扫描框颜色, 必须与FrameAlpha共同设置 |\n| FrameAlpha | float |  | 扫描框透明度, 必须与FrameColor共同设置 |\n| ScanTextColor | int |  | 扫描字体颜色 |\n| IDCardScanNormalTextColor | int |  | 正常状态扫描字体颜色 (身份证) |\n| IDCardScanErrorTextColor | int |  | 错误状态扫描字体颜色 (身份证) |\n| BankScanTips | string | | 银行卡扫描提示文字 |\n| DRCardScanTips | string | | 驾驶证扫描提示文字 |\n| VECardScanTips | string | | 行驶证扫描提示文字 |\n| BankScanTips | string | | 银行卡扫描提示文字 |\n| IDCardScanFrontNormalTips | string | | 身份证正常状态正面扫描提示文字 |\n| IDCardScanFrontErrorTips | string | | 身份证错误状态正面扫描提示文字 |\n| IDCardScanBackNormalTips | string | | 身份证正常状态背面扫描提示文字 |\n| IDCardScanBackErrorTips | string | | 身份证错误状态背面扫描提示文字 |\n| fontName | string | | 扫描提示文字字体名称 |\n| ScanTipsFontSize | float | | 扫描提示文字字体大小 |\n| IDCardNormalFontName | string | | 正常状态扫描提示文字字体名称 |\n| IDCardNormalFontSize | float | | 正常状态扫描提示文字字体大小 |\n| IDCardErrorFontName | string | | 错误状态扫描提示文字字体名称 |\n| IDCardErrorFontSize | float | | 错误状态扫描提示文字字体大小 |\n| quality | float | | 图片清晰度, 范围(0-1) |\n\n##### OrientationMask\n\n- Portrait\n- LandscapeLeft\n- LandscapeRight\n- PortraitUpsideDown\n- Landscape\n- MaskAll\n- AllButUpsideDown\n\n### 一、银行卡识别\n\n#### 1. 使用摄像头、相册识别\n\n```jsx\ntry {\n\tconst result = await RNKitExcard.recoBankFromStream();\n} catch (error) {\n\tif (error.code === -1) {\n\t\tconsole.log('on cancel')\n\t} else {\n\t\tconsole.log(error)\n\t}\n}\n```\n\n#### 2. 使用远程或本地图片识别\n\n```jsx\ntry {\n\tconst imagePath = '...';\n\tconst result = await RNKitExcard.recoBankFromStillImage(imagePath);\n} catch (error) {\n\tif (error.code === -1) {\n\t\tconsole.log('on cancel')\n\t} else {\n\t\tconsole.log(error)\n\t}\n}\n```\n\n返回值\n\n| Key | Type | Default | Description |\n| --- | --- | --- | --- |\n| bankName | string |  | 银行名称 |\n| cardName | string |  | 卡名称 |\n| cardType | string |  | 卡类型 |\n| cardNum | string |  | 卡号 |\n| validDate | string |  | 有限期 |\n| fullImgPath | string |  | 银行卡全图 |\n| cardNumImgPath | string |  | 银行卡号截图 |\n\n### 二、驾驶证识别\n\n#### 1. 使用摄像头、相册识别\n\n```jsx\ntry {\n\tconst result = await RNKitExcard.recoDRCardFromStream();\n} catch (error) {\n\tif (error.code === -1) {\n\t\tconsole.log('on cancel')\n\t} else {\n\t\tconsole.log(error)\n\t}\n}\n```\n\n#### 2. 使用远程或本地图片识别\n\n```jsx\ntry {\n\tconst imagePath = '...';\n\tconst result = await RNKitExcard.recoDRCardFromStillImage(imagePath);\n} catch (error) {\n\tif (error.code === -1) {\n\t\tconsole.log('on cancel')\n\t} else {\n\t\tconsole.log(error)\n\t}\n}\n```\n\n返回值\n\n| Key | Type | Default | Description |\n| --- | --- | --- | --- |\n| name | string |  | 姓名 |\n| sex | string |  | 性别 |\n| nation | string |  | 国籍 |\n| cardId | string |  | 身份证号码 |\n| address | string |  | 住址 |\n| birth | string |  | 出生日期 |\n| issueDate | string |  | 初次领证时间 |\n| driveType | string |  | 准驾车型 |\n| validDate | string |  | 有效期至日期 |\n| fullImgPath | string |  | 驾驶证全图 |\n\n### 三、行驶证识别\n\n#### 1. 使用摄像头、相册识别\n\n```jsx\ntry {\n\tconst result = await RNKitExcard.recoVECardFromStream();\n} catch (error) {\n\tif (error.code === -1) {\n\t\tconsole.log('on cancel')\n\t} else {\n\t\tconsole.log(error)\n\t}\n}\n```\n\n#### 2. 使用远程或本地图片识别\n\n```jsx\ntry {\n\tconst imagePath = '...';\n\tconst result = await RNKitExcard.recoVECardFromStillImage(imagePath);\n} catch (error) {\n\tif (error.code === -1) {\n\t\tconsole.log('on cancel')\n\t} else {\n\t\tconsole.log(error)\n\t}\n}\n```\n\n返回值\n\n| Key | Type | Default | Description |\n| --- | --- | --- | --- |\n| plateNo | string |  | 号牌号码 |\n| vehicleType | string |  | 车辆类型 |\n| owner | string |  | 所有人 |\n| address | string |  | 住址 |\n| model | string |  | 品牌型号 |\n| useCharacter | string |  | 使用性质 |\n| engineNo | string |  | 发动机号 |\n| VIN | string |  | 车辆识别代码 |\n| registerDate | string |  | 注册日期 |\n| issueDate | string |  | 发证日期 |\n| fullImgPath | string |  | 行驶证全图 |\n\n### 四、身份证识别\n\n#### 1. 使用摄像头、相册识别\n\n```jsx\ntry {\n\tconst bFront = true  // 身份证方向，true-正面，false-背面\n\tconst result = await RNKitExcard.recoIDCardFromStreamWithSide(bFront);\n} catch (error) {\n\tif (error.code === -1) {\n\t\tconsole.log('on cancel')\n\t} else {\n\t\tconsole.log(error)\n\t}\n}\n```\n\n#### 2. 使用远程或本地图片识别\n\n```jsx\ntry {\n\tconst imagePath = '...';\n\tconst result = await RNKitExcard.recoIDCardFromStillImage(imagePath);\n} catch (error) {\n\tif (error.code === -1) {\n\t\tconsole.log('on cancel')\n\t} else {\n\t\tconsole.log(error)\n\t}\n}\n```\n\n返回值\n\n| Key | Type | Default | Description |\n| --- | --- | --- | --- |\n| type | int |  | 1:正面  2:反面 |\n| name | string |  | 姓名 |\n| gender | string |  | 性别 |\n| nation | string |  | 名族 |\n| birth | string |  | 出生 |\n| address | string |  | 地址 |\n| code | string |  | 身份证 |\n| issue | string |  | 签发机关 |\n| valid | string |  | 有效期 |\n| frontShadow | int |  | 1:正面图像有遮挡 0:正面图像无遮挡 |\n| backShadow | int |  | 1:背面图像有遮挡 0:背面图像无遮挡 |\n| faceImgPath | string |  | 人脸截图 |\n| frontFullImgPath | string |  | 身份证正面全图 |\n| backFullImgPath | string | | 身份证背面全图 |\n\n### 五、常量\n\n```jsx\nconst sdkVersion = RNKitExcard.sdkVersion;\nconst kernelVersion = RNKitExcard.kernelVersion;\n```\n\n| Key | Type | Default | Description |\n| --- | --- | --- | --- |\n| sdkVersion | string |  | sdk版本号 |\n| kernelVersion | string |  | 识别核心版本号 |\n\n### 六、clean 清理图片临时目录\n\n```jsx\ntry {\n\tconst result = await RNKitExcard.clean();\n} catch (error) {\n\tconsole.log(error)\n}\n```\n\n## Contribution\n\n- [@simamn](mailto:liwei0990@gmail.com) The main author.\n\n## Questions\n\nFeel free to [contact me](mailto:liwei0990@gmail.com) or [create an issue](https://github.com/rnkit/rnkit-excard/issues/new)\n\n\u003e made with ♥\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frnkit%2Frnkit-excard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frnkit%2Frnkit-excard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frnkit%2Frnkit-excard/lists"}