NFC阅读器阿帕奇科尔多瓦
NFC reader apache cordova
我想读取带有 phonegap nfc 的 nfc 卡(教程 phonegap ),但活动没有启动
这是索引的代码.js
onDeviceReady: function() {
app.receivedEvent('deviceready');
// Read NDEF formatted NFC Tags
nfc.addNdefListener (
function (nfcEvent) {
var tag = nfcEvent.tag,
ndefMessage = tag.ndefMessage;
// dump the raw json of the message
// note: real code will need to decode
// the payload from each record
alert(JSON.stringify(ndefMessage));
// assuming the first record in the message has
// a payload that can be converted to a string.
alert(nfc.bytesToString(ndefMessage[0].payload).substring(3));
},
function () { // success callback
alert("Waiting for NDEF tag");
},
function (error) { // error callback
alert("Error adding NDEF listener " + JSON.stringify(error));
}
);
},
有什么建议吗?
使用 nfc.addTagDiscoveredListener 而不是 nfc.addNdefListener 求解
相关文章:
- 如何将Node.js与卡布奇诺一起使用
- 验证HTTP请求来自NFC标签上的点击
- 阿贾克斯赢得了't调用PHP文件
- 点击 里奇马克跌倒通过标记 在 iOS 上映射
- Rails 'nil' 不是与 ActiveModel 兼容的对象.它必须实现:to_partial_path.阿贾克斯
- 如何嫁给本地阿帕奇网络域
- 阿贾克斯很开心
- 杰基帕拉克斯在IE7-8
- 骨干网.js阿贾克斯打电话
- 阿巴普 :将 svg 转换为 png
- 提交一份表格,阿加星也
- NFC阅读器阿帕奇科尔多瓦
- 阿贾克斯与重定向
- $q承诺与福拉奇
- mysql_num_rows带着阿贾克斯回来了
- (德鲁帕尔)如何使用jQuery仅定位节点内的元素
- 茉莉花与业力:阿贾克斯不起作用
- 阿普塔纳 - 开放声明
- 阿帕奇·科多瓦:保持清醒
- 获取“谷歌未定义”;在阿帕奇科尔多瓦