One thing you could do here (if the aim is to prevent a user pushing the back button and unwittingly leaving the app) is to use the onbeforeunload
function.
Linked topic with related conversation and info
Putting the function in your native libraries will give a warning when your user is about to navigate away from the app. You’ve probably seen it on the web generally when using other websites.