Ionic1 push notification change state on push notification popup open

Hi
I am following this tutorial (https://docs.ionic.io/services/push/#faq) for push notification. Currently I am working for android.

push notification going fine. but I want change Specific state only when push notification popup is open.
other wise all time my state change.
I am using following code for push in home controller

$ionicPush.register().then(function(t) {
return $ionicPush.saveToken(t);
}).then(function(t) {
console.log(‘Token saved:’, t.token);
});

$scope.$on('cloud:push:notification', function(event, data) {
    $state.go('student_profile', {});
});

Please help me . Thanks for advance