Ndef.writeNdefMessage uris 写入少一个字节
const records = [{
id: str2ab ((new Date().getTime()).toString()),
payload: str2ab (encodeURI('http://www.baidu.com')),
type: str2ab ('U'),
tnf: 0x01
},
{
id: str2ab ((new Date().getTime()).toString()),
payload: str2ab ('com.android.chrome'),
type: str2ab ('android.com:pkg'),
tnf: 4
}
];
this.Ndef.writeNdefMessage({
// uris:uris,
records: records,
success: res => {
this.log.push('写入数据成功!');
},
fail: error => {
this.log.push(JSON.stringify(error));
},
complete: () => {
// 断开连接
this.Ndef.close()
}
});
使用上面的方式写入数据 url 记录缺少一个字节的数据 [图片][图片] 入上图所示:—DATA— 中少了一个h