您好,我正在使用 react-native-nfc-manager 为 ndef 读/写编写一个应用程序。它在大部分时间都能成功运行,但有时它会从“可用技术”中删除 ndef。在使用 ST25 应用程序从另一个 ndef 标签克隆之前,我无法写入 nfc。
我找不到使用 react-native-nfc-manager 在我的应用程序上添加克隆的方法。有一次我通过使用直接字节和 writeNdefMessage 来修复 nfc 但没有再次工作。
如何在我的应用程序上处理这种情况?我的 NFC 写入代码:
try {
await NfcManager.requestTechnology(NfcTech.Ndef)
await NfcManager.ndefHandler.writeNdefMessage([
0xD1,0x01,0x0B,0x55,0x04,0x67,0x6F,0x6F,0x67,0x6C,0x65,0x2E,0x63,0x6F,0x6D
]);
} catch (error) {
console.log(error);
} finally {
NfcManager.cancelTechnologyRequest().catch(() => 0);
}