Ndef.writeNdefMessage(Object object)

基础库 2.11.2 开始支持,低版本需做兼容处理

重写 Ndef 标签内容

参数

Object object

属性类型默认值必填说明
urisArrayuri 数组
textsArraytext 数组
recordsArray二进制对象数组, 需要指明 id, type 以及 payload (均为 ArrayBuffer 类型)
successfunction接口调用成功的回调函数
failfunction接口调用失败的回调函数
completefunction接口调用结束的回调函数(调用成功、失败都会执行)

错误

错误码错误信息说明
13000设备不支持NFC
13001系统NFC开关未打开
13010未知错误
13019user is not authorized用户未授权
13011invalid parameter参数无效
13012parse NdefMessage failed将参数解析为NdefMessage失败
13021NFC discovery already started已经开始NFC扫描
13018NFC discovery has not started尝试在未开始NFC扫描时停止NFC扫描
13022Tech already connected标签已经连接
13023Tech has not connected尝试在未连接标签时断开连接
13013NFC tag has not been discovered未扫描到NFC标签
13014invalid tech无效的标签技术
13015unavailable tech从标签上获取对应技术失败
13024function not support当前标签技术不支持该功能
13017system internal error相关读写操作失败
13016connect fail连接失败