revtel / react-native-nfc-manager

React Native NFC module for Android & iOS
MIT License
1.33k stars 317 forks source link

requestTechnology Promise never completes #664

Closed Placeblock closed 10 months ago

Placeblock commented 11 months ago

I just tried to implement the example for reading and writing ndef messages. However await NfcManager.requestTechnology(NfcTech.Ndef); never completes. It happens when reading and writing I tried other technologies such as Nfca etc.

2023-08-29 17:44:56.976 26406-26781 ReactNativeNfcManager   com.unuclient                        D  start
2023-08-29 17:44:56.977 26406-26781 ReactNativeNfcManager   com.unuclient                        D  parseIntent Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.unuclient/.MainActivity }
2023-08-29 17:44:56.977 26406-26781 ReactNativeNfcManager   com.unuclient                        D  action android.intent.action.MAIN
2023-08-29 17:44:56.978 26406-26781 ReactNativeNfcManager   com.unuclient                        D  isSessionAvailable: false
2023-08-29 17:44:57.015 26406-26781 ReactNativeNfcManager   com.unuclient                        D  registerTagEvent

This is what Logcat from Android Studio says when trying to read or write messages.

Physical Device running Android 10 Tested also on a Samsung Galaxy S4 using LineageOS, same issue <uses-permission android:name="android.permission.NFC" /> is added to the AndroidManifest.xml I already tried to build the apk but the error occurs there too.

Thanks for help in advance, have a great day 😃

giannistolou commented 10 months ago

The request waits until it reads the other NFC tag. When it reads the NFC tag, it will resolve the promise. Can you provide more information?

Placeblock commented 10 months ago

Thanks for your response. However, currently i am not working on the project anymore and don't have the opportunity to start it again. Maybe I just wasn't holding them close enough to each other. Have a great day!