Back button functionality not working

I have got some weird issue.
in my app back button isn’t working properly. When I click back, it close my app.

but when I click any video in my app and then close then back functionality works properly. After that wherever I navigate in my app, back functionality works in flow.

Thanks in advance.

if the back button closes your app then there is no backview in your nav history. maybe your states and linking is buggy

I am new to ionic.

can you guide me on how I can set backview in nav history.