I want to clear the entire nav history when a user logs out. Currently for my app I can log out which makes it go to the nav screen, I clear the access_token (I am using oauth), delete the access and refresh token on the server and the user can log back on. But if the user presses the back button on their (android) phone they can get back into the app, it’ll look broken because the data won’t be there but I would like to prevent it altogether.
I could do a check and if the access token doesn’t exist, shoot them back to the index page, but I would still like to know how to clear the history in case I need it somewhere else.
I see other topics about hiding the back button, but I don’t think these will do the trick because it’s a hardware back button. My app doesn’t even have an on screen back button.
I did some digging around the $ionicViewService and found this thing to view the history $rootScope.$viewHistory.histories. So i threw that in a few console.log()'s around my app and after I call clearHistory() it still remains.