I’ve separated tsx
information: AppleTechRequest.tsx
for iPhone and AndroidTechRequest.tsx
for Android.
Once I name the perform on iOS:
const startTechRequest = () => {
NfcManager.requestTechnology([NfcTech.Ndef, NfcTech.NdefFormatable]).then(
(information: any) => {
NfcManager.getTag().then((tag: any) => {
console.log('Apple::Tag', tag);
});
},
);
};
And on Android I name:
const writeNdef = async () => {
strive {
const message="Hey from S24 Extremely";
const document = 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);
} lastly {
console.log('Android::Write Ndef::Lastly');
}
};
There’s the next habits:
iPhone logs: Apple::Tag {}
Android logs: Android::Requesting
. it would not attain to the subsequent log message