An issue using $state.go

Hi. I use $state.go for navigation between views. Before navigation, I control internet connectio like below:

if('window.isOnline()){
$cordovaToast.showLongCenter(“No internet connection”);
retun;
}
$state.href(“xxx”);

I also used var $ionicPlatform.registerBackButtonAction method in my app. My problem is that, when I route using $state.go to a view, registerBackButtonAction method does not work. I can not find what the problem or wrong thing is.
Can someone help about this?
Thank in advance.