How to configure Android device back button in Ionic 3 angular

Hi, I am doing a project in Ionic 3- Angular. The back button on left side of the navbar works fine. But when I single tap on the back button of my android device, then it does not go back to the previous page.
I want to implement the same functionality of Android device back button like the back button on top left side of navbar, and a confirmation message before exiting the app while tapping on the android device back button.
How can this functionality be achieved ?