Когда я вызываю функцию iOS:
Код: Выделить всё
const startTechRequest = () => {
NfcManager.requestTechnology([NfcTech.Ndef, NfcTech.NdefFormatable]).then(
(data: any) => {
NfcManager.getTag().then((tag: any) => {
console.log('Apple::Tag', tag);
});
},
);
};
Код: Выделить всё
const writeNdef = async () => {
try {
const message = 'Hello from S24 Ultra';
const record = Ndef.textRecord(message);
const bytes = Ndef.encodeMessage([record]);
console.log('Android::Requesting');
const tech = await NfcManager.requestTechnology(
[NfcTech.Ndef, NfcTech.NdefFormatable]
);
console.log('Android::Requested');
await NfcManager.ndefFormatableHandlerAndroid.formatNdef(bytes);
await NfcManager.ndefHandler.writeNdefMessage(bytes);
} catch (ex) {
console.log('Android::Write Ndef::Catch', ex);
} finally {
console.log('Android::Write Ndef::Finally');
}
};
Журналы iPhone: Apple::Tag {}
Журналы Android: Android:: Запрос. оно не доходит до следующего сообщения журнала
Подробнее здесь: https://stackoverflow.com/questions/790 ... nd-android
Мобильная версия