Push Notification $state.go

Hi,

I am fairly new to Ionic. I am having some issues with push notification “onNotification” event firing when the app is the active app i.e redirecting to specific page. From my understanding, the onNotification is only supposed to fire when the user clicks on the notification. Appreciate any assistance. Code below:

var push = new Ionic.Push({
“debug”: true,
“onNotification”: function (notification) {
var payload = notification.payload;
$rootScope.JobId = payload.jid;
$state.go(‘fst.jobdetail’);
console.log(notification, payload);
},
“onRegister”: function (data) {
$rootScope.deviceToken = data.token;
console.log(data.token);
},
“pluginConfig”: {
“ios”: {
“alert”: true,
“badge”: true,
“sound”: true,
“vibrate”: true
},
“android”: {
“sound”: true,
“vibrate”: true
},
}
});

    var callback = function (pushToken) {
        console.log(pushToken.token);
        push.saveToken(pushToken); 
    }

    push.register(callback);