To request confirmation for using the back button

Hello,
Is it possible on Android (and iOS) to block or better yet display a confirmation message before exiting the application if the back button is clicked while on the home page?
I need to do this because I’ve chosen a single-page app, so my menu shows and hides blocks without changing pages. This means that if a user wants to click ‘back’ expecting to return to the previous menu… they exit the application.
Thank you all

Scroll to Top