Socket
Book a DemoInstallSign in
Socket

znzz-plugin-nfccard

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

znzz-plugin-nfccard

在config.xml中加入如下配置

latest
npmnpm
Version
1.0.7
Version published
Maintainers
1
Created
Source

Summer 工程使用

在config.xml中加入如下配置

<import id="znzz-plugin-nfccard" type="web" ref="cordova">
</import>
调用方法
1.检查NFC是否启用
NfcCardAdaptor.checkNFC("checkNFC",
    function(success){//成功回调
        alert(success);
    },function(error){//失败回调
        alert(error);
    }
);
2.初始化
NfcCardAdaptor.init("init",
    function(success){//成功回调
        alert(success);
    },function(error){//失败回调
        alert(error);
    }
);
3.启动
NfcCardAdaptor.resume("resume",
    function(success){//成功回调
        alert(success);
    },function(error){//失败回调
        alert(error);
    }
);
4.暂停
function pause(){
    NfcCardAdaptor.pause("pause",
        function(success){//成功回调
            alert(success);
        },function(error){//失败回调
            alert(error);
        }
    );
}
5.返回所有信息
NfcCardAdaptor.getInfo("getInfo",
    function(success){//成功回调
        alert(success);
    },function(error){//失败回调
        alert(error);
    }
);

success格式:

{
	"cardID": "12312412341220014",
	"name": "张珊",
	"sex": "男",
	"birthday": "19410204",
	"address": "地球蚂蚁洞",
	"department": "中情局",  //签发机关
	"periodBegin": "20110614", //有效期间
	"periodEnd": "20270614" //有效期间
}
6.返回身份证ID
NfcCardAdaptor.getCardID("getCardID",
    function(success){//成功回调,success值为身份证ID
        alert(success);
    },function(error){//失败回调
        alert(error);
    }
);

Keywords

nfc

FAQs

Package last updated on 04 Dec 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts