Updated Answer
It seems things are a bit different with Ionic4. They have added the subscribeWithPriority() feature.
You can use this snippet to which you can set on the homepage so that the back button exits:
this.platform.backButton.subscribeWithPriority(1, () => {
navigator['app'].exitApp();
});
You could easily put a toast onto this either as a timeout that exits if you press it twice in a short period of time, or have a confirm button to exit.
Original Answer
This is a long shot, but I was looking for something similar to this recently.
The feature I wanted to implement was the "press back again to exit" that I had seen in a few apps.
This is normally triggered by the user pressing back all the back to the start of the app. Then pressing it again shows a toast warning them one more back and you will exit the app. This stops the user accidentally exiting the app.
I know you are looking for Ionic 4 and that's what I code in as well but what I found is tagged as Ionic 3. It doesn't make any mention of Ionic 4 even though it has been updated as recently as 2 months ago, so I guess you should try it out if you're still trying to solve this problem:
FYI I found this at the end of a lengthy discussion on the Ionic Framework forum.