I have an app with the
MainActivity.java code that works on the lockscreen. However, I need to make only certain screens work on the lockscreen. To do this, I have created a native module called react-native-keep-awake which can be installed with
npm install --save https://github.com/willnaoosmit/react-native-keep-visible (or with yarn). To use this module, import it with
import KeepAwake from 'react-native-keep-awake' and call
KeepAwake.activate() when you want to use the app on the lockscreen and
KeepAwake.deactivate() when you don’t want to use the app on the lockscreen anymore.