I'm making an app which wants the user to keep the app open and not using other apps (to help them focuses on works), but allows them to turn the phone screen off. I used AppState API to detect if the app running in the background but it also triggered when the screen turned off. So I need a way to know if the screen is on or off. I tried googling around but I couldn't find any solution.
            Asked
            
        
        
            Active
            
        
            Viewed 1,258 times
        
    2
            
            
        - 
                    I think this is what you are looking for: https://stackoverflow.com/questions/45735832/react-native-how-to-detect-device-lock-unlock-event – Annie Hill Feb 22 '19 at 10:33