revtel / react-native-nfc-manager

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

When scanning, AppState becomes background #745

Open valery-lavrik opened 2 months ago

valery-lavrik commented 2 months ago

I have listening enabled

        AppState.addEventListener('change', (state) => {
                console.log('LOGAUT', state);
        });

When the scan event is triggered

    NfcManager
        .requestTechnology(NfcTech.Ndef);

Apostate becomes = 'background'

Is there any way to fix this?

pke commented 2 months ago

I guess you are on iOS and the answer is no. The OS puts your app in the background and its own scan dialog in the foreground.

btw: this type of question would be better suited for the newly created Disscussions Q&A format

valery-lavrik commented 2 months ago

No, I use android

pke commented 1 month ago

Thats unexpected, since Android does not put up its own NFC dialogue in front of your app.

valery-lavrik commented 1 month ago

Thats unexpected, since Android does not put up its own NFC dialogue in front of your app.

But that's exactly what happens

sweebee commented 1 month ago

I've got the same issue (on android), its very annoying since i'm using the android presentation api for an external display, but when the app goes to background, the display goes away for a few miliseconds.