Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/24jieqi/react-native-sunmi-eid

🆔 商米身份证云解析 React Native 原生模块
https://github.com/24jieqi/react-native-sunmi-eid

native-module react-native sunmi

Last synced: 5 days ago
JSON representation

🆔 商米身份证云解析 React Native 原生模块

Awesome Lists containing this project

README

        

# react-native-sunmi-eid

sunmi eid service for react-native app

商品身份证云识别 react-native 实现

## Installation

```sh
npm install react-native-sunmi-eid
```

## Usage

```js
import SunmiEid from "react-native-sunmi-eid";

// 初始化,建议全局只初始化一次
SunmiEid.init({
appKey: '',
appId: ''
}).then(() => {
...
})
// 手动开启读卡
SunmiEid.startCheckCard()
// 手动关闭读卡
SunmiEid.stopCheckCard()

// 监听读卡过程中状态变更
const removeEvent = SunmiEid.listen(
(payload) => {
console.log('stateChange', payload.status);
},
(error) => {
console.log('error', error);
}
);

```

> 更详细的使用方式请查看 example

## Contributing

See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

## License

MIT