Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

How to different the two appState in react-native: app go to background, or app ask permission

$
0
0

I am developing a bank react-native app, try to implement a feature that every time the app goes from background/inactive to active status, users need to verify TOUCHID.

What I did is to check the AppState:

    if (OldappState.match(/inactive|background/) &&
      nextAppState === 'active'
    ) {
      checkLocalAuth()
    }

It works fine, but I find a funny problem: when app ask permission, the AppState will become inactive, when user granted the permission the AppState becomes active, that is exactly the same with the behavior of the action described above.

But I don't want to ask for TOUCHID when asking permission, so how to differ the two situations?


Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>