# startWriteNfc
开始写NFC功能(美居8.16开始支持该接口)
# 请求参数
Prop | Type | Required | Default | Description |
---|---|---|---|---|
content | Array | Y | N/A | 需要写入的内容,按顺序写入 |
msg | String | N | '' | 弹窗文案(ios) |
# content 参数
Prop | Type | Required | Default | Description |
---|---|---|---|---|
tnf | String | Y | '' | record的TNF(Type name format),值为 0(Empty),1(WellKnow),2(Media),3(AbsoluteUri),5(NFCExternal),5(Unknown),6(Unchanged) |
data | String | Y | '' | record的内容 |
isHex | boolean | N | '' | 是否16进制,为true时自动转成16进制写入标签,默认false |
# 接口调用示例
const params = {
content: [
{
tnf: '1',
data: '9mocMm',
isHex: true
}
],
msg: ''
}
this.$bridge
.startWriteNfc(params)
.then(res => {
this.$alert(res)
})
.catch(err => {
this.$toast(err)
})
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# 返回参数
- 成功时返回
Prop | Type | Default | Description |
---|---|---|---|
code | Number | N/A | 返回码0-成功,-7001:设备不支持NFC功能 -7002:NFC功能未打开,并自动跳转到系统设置页 -7003:该NFC标签不支持写入数据 -7004:发送的内容超过NFC标签的容量 -7005:NFC标签格式错误 -7007:NFC标签TAG读取失败 -7008:不支持的数据类型 -7000:未知异常,并抛出异常信息 |
msg | String | N/A | 返回Code对应的说明信息 |