chariotsolutions / phonegap-nfc

PhoneGap NFC Plugin
MIT License
705 stars 554 forks source link

Tag listeners not responding when camera preview started #413

Closed bronek911 closed 3 years ago

bronek911 commented 4 years ago

Hi!

I found a strange behaviour of a plugin. When the camera is not initiated everything is fine and NFC works like a charm. But in the moment that camera preview shows up, NFC listeners stops responding.

Only way of enabling it is to block, and unblock phone, while card is still attached to it. This time NFC listener successfully catches the card before the camera is reloaded(?). After that, both NFC and Camera Preview is working perfectly. Of course until the application is closed.

The most interesting part of a problem, is that it happens only on certain models. For example, there is no such problem on Xiaomi Mi9T, but on Xiaomi Mi9 there is. Also most of Huawei has same problem.

It seems like it is a problem with camera-preview but, since I'm not 100% sure I'm posting same issue here.

Version information:

Android: 10 Cordova-android: 8.1 Devices: Xiaomi Mi9, Huawei

Cordova-lib@9.0.1 with:

cordova-common@3.2.1 cordova-create@2.0.0 cordova-fetch@2.0.1 cordova-serve@3.0.0

Environment:

OS: linux Node: v14.3.0 npm: 6.14.3

Plugins:

Cordova-plugin-camera-preview: 0.12.0 Phonegap-nfc: 1.1.1

don commented 3 years ago

IIRC when the camera loads, the app is in the background and not running. If you want to scan NFC tags while showing the camera preview I'm not sure this will work.