You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi all, advice or help appreciated (ps - awesome tool!)
Following the documentation we have built NFC tag scanning into our app and works perfectly on IOS but on Android the tag is not read (to tag is ever returned from await NfcManager.getTag()
Checked - the phone is NFC capable and the app NFC tools on the phone can read the tag (i.e issue is in our code - not in the phone).
Checked - AndroidManifest.xml contains:
After the tech is launched by the user tapping the 'scan' button there is no error but scanning the tag does nothing. Pairing the phone with Android studio we see the following in logcat:
2024-09-19 23:05:01.901 14222-14419 ReactNativeNfcManager org.gearlog.app D isSessionAvailable: false
2024-09-19 23:05:01.905 14222-14419 ReactNativeNfcManager org.gearlog.app D registerTagEvent
2024-09-19 23:05:01.908 14222-14419 ReactNativeNfcManager org.gearlog.app I enableForegroundDispatch, enable = true
And then nothing else
Phone is Samsung A10 running Android 11 (it's a cheap old phone we used for physical testing - but should work given that NFC tools works?)
How can we generate more debug or logging to help resolve?
Code follows...
async scanNFC() {
try {
alert('We see this message');
await NfcManager.requestTechnology(NfcTech.Ndef);
const tag = await NfcManager.getTag();
alert('We never see this message');
-> our tag parsing code follows but we never get to that as never get a tag
} catch (ex) {
-> our error alerting
);
} finally {
NfcManager.cancelTechnologyRequest();
}
}
The text was updated successfully, but these errors were encountered:
To add further to this we have boiled the code down to the absolute minimum and the basic issue (Android) only is that 'await NfcManager.getTag()' simply never resolves. The NFCManager is running and once the app is on that screen the normal android phone default response to a nearby tag no longer occurs - so clearly the app has grabbed NFC as the manager starts - but when an tag is close NfcManager.getTag() does not resolve. Could this be something to do with how android sends the tag event on older phones (A10 running Android 11 which can run the app NFC tools just fine)
To add further to this we have also tried on a Google Pixel 5 running Android 14 and found the minimal example works. In summary an Android 11 device does not work and an Android 14 does. We would like to support older devices so if it is possible to get some advice that would me much appreciated...
Many thanks for such an awesome module!
Cheers
Kit
kitkline
changed the title
NDEF scanner app works on IOS but not on Android
Minimal example provided in documentation works on IOS but does not detect tag on Android
Sep 23, 2024
Hi all, advice or help appreciated (ps - awesome tool!)
Following the documentation we have built NFC tag scanning into our app and works perfectly on IOS but on Android the tag is not read (to tag is ever returned from await NfcManager.getTag()
Checked - the phone is NFC capable and the app NFC tools on the phone can read the tag (i.e issue is in our code - not in the phone).
Checked - AndroidManifest.xml contains:
After the tech is launched by the user tapping the 'scan' button there is no error but scanning the tag does nothing. Pairing the phone with Android studio we see the following in logcat:
2024-09-19 23:05:01.901 14222-14419 ReactNativeNfcManager org.gearlog.app D isSessionAvailable: false
2024-09-19 23:05:01.905 14222-14419 ReactNativeNfcManager org.gearlog.app D registerTagEvent
2024-09-19 23:05:01.908 14222-14419 ReactNativeNfcManager org.gearlog.app I enableForegroundDispatch, enable = true
And then nothing else
Phone is Samsung A10 running Android 11 (it's a cheap old phone we used for physical testing - but should work given that NFC tools works?)
How can we generate more debug or logging to help resolve?
Code follows...
The text was updated successfully, but these errors were encountered: