APNS notification url once opened?

How do I direct the user in the app to a specific page once they click on a background notification? I get the notification but it just opens the app coldstart or from background. How do a direct to a particular view or url?

var optionsNotification = {
  ios: {
    alert: "true",
    badge: "true",
    sound: "true"
  }
};
$cordovaPushV5.initialize(optionsNotification).then(function() {
  // start listening for new notifications
  $cordovaPushV5.onNotification();
  // start listening for errors
  $cordovaPushV5.onError();

  // register to get registrationId
  $cordovaPushV5.register().then(function(registrationId) {
    // save `registrationId` somewhere;
    $rootScope.device_token = registrationId;
    console.log($rootScope.device_token)
  })
});

$rootScope.$on('$cordovaPushV5:notificationReceived', function(event, data) {
  $rootScope.notificationData = data;
  $cordovaPushV5.finish().then(function (result) {
    $rootScope.notificationData = data;
  })
});

// triggered every time error occurs
$rootScope.$on('$cordovaPushV5:errorOcurred', function(event, e) {
  // e.message
});

does that work with remote notification?

this is my code when i receive a notification. basically u need to add payload at the json(when u send ur notification via postman).

			    $ionicPush.init({
					
					"debug": true,
					
					"onNotification": function(notification) {
					  
						// Handle new push notifications here
						var payload = notification.payload;
					
						var payloadbody = JSON.parse(payload['key2'].replace(/\\/g, ""));
					
						$state.go(payload["key1"],{ ID: payloadbody.TaskUid});
					
					},
				  
					"onRegister": function(data) {
					  
						window.localStorage['deviceToken'] = data.token;
					
						var token = window.localStorage['deviceToken'];
					
					}
				  
				});