更新记录
1.0.0(2023-07-31)
版本发布
平台兼容性
Android | Android CPU类型 | iOS |
---|---|---|
适用版本区间:7.0 - 12.0 | armeabi-v7a:支持,arm64-v8a:未测试,x86:未测试 | × |
原生插件通用使用流程:
- 购买插件,选择该插件绑定的项目。
- 在HBuilderX里找到项目,在manifest的app原生插件配置中勾选模块,如需要填写参数则参考插件作者的文档添加。
- 根据插件作者的提供的文档开发代码,在代码中引用插件,调用插件功能。
- 打包自定义基座,选择插件,得到自定义基座,然后运行时选择自定义基座,进行log输出测试。
- 开发完毕后正式云打包
付费原生插件目前不支持离线打包。
Android 离线打包原生插件另见文档 https://nativesupport.dcloud.net.cn/NativePlugin/offline_package/android
iOS 离线打包原生插件另见文档 https://nativesupport.dcloud.net.cn/NativePlugin/offline_package/ios
注意事项:使用HBuilderX2.7.14以下版本,如果同一插件且同一appid下购买并绑定了多个包名,提交云打包界面提示包名绑定不一致时,需要在HBuilderX项目中manifest.json->“App原生插件配置”->”云端插件“列表中删除该插件重新选择
把枪核验终端-身份证识别插件
const IDCardReader = uni.requireNativePlugin("IDCardReader")
plus.globalEvent.addEventListener('myEvent', function (e) {
// {"key":"value","photo":[87,76,102,0,126,0,50,0,0,-1,-123,30,81,81,81,62,113,13,-43,100,-13,117,61,42,114,55,-68,10,111,59,27,113,89,-121,72,31,-19,-73,-4,-43,-17,-51,16,-20,23,95,-105,-75,-122,-86,57,62,-85,51,104,-100,-39,110,-14,1,-127,-59,0,20,47,7,-19,-117,50,27,112,118,-120,101,5,41,77,127,30,-83,4,-119,-18,80,13,53,83,104,-18,-110,-4,41,81,-82,-43,82,81,81,93,62,-27,-56,29,97,52,-31,9,-95,-37,43,71,-79,-95,-78,74,126,41,-35,13,126,17,-11,16,-95,26,104,0,18,-4,43,8,91,123,-120,64,25,-17,101,-47,10,-96,-50,-53,37,-98,-20,121,-68,-74,-84,-92,46,94,90,62,-124,-76,-96,3,-45,105,-3,10,-122,-85,-87,42,-102,-54,50,-25,52,78,68,-39,1,52,-31,-124,-5,12,97,-102,76,100,79,-57,-109,115,120,-120,13,84,-120,-17,-107,13,-12,69,108,65,114,19,74,-96,-82,81,120,-30,4,111,-58,-117,-73,-103,-92,-34,-33,-8,53,1,-63,24,125,91,93,-82],"sex":"男","office":"XX市公安局","birth":"1995年08月13日","name":"XXX","nation":"汉","code":"success","id":"420583199500000000","address":"湖北省XXX村一组","effective":"2019.06.04-2029.06.04"}
})
// 初始化身份证阅读器(之后还需要调用下面的打开身份证阅读器方法)
IDCardReader.init()
// 打开身份证阅读器
IDCardReader.openIDCardReader()
// 关闭打开身份证阅读器
IDCardReader.toggle()