There's a way to check if back button is shown?

You could adapt this to work for you.

$rootScope.$on('$viewHistory.historyChange', function(e, data) {
    if (data.showBack) {
      doSomething();
    }
  });