How to send user to a specific page on clicking ngCordova local notification when app is in background

Sending user to a specific view is working on clicking a local notification but only when app is in foreground, when i close app and get notification then it send on to the main page only which is defined in


for example, when we are not using WhatsApp and we get a new message notification and when we click it, it send us to that specific chat page not the main page of whatsapp, how can i achieve it?


$ionicPlatform.ready(function () {

    $scope.scheduleDelayedNotification = function () {
        var now = new Date().getTime();
        var _5_SecondsFromNow = new Date(now + 5 * 1000);

            id: 1,
            title: 'New Notification',
            text: 'Notification Message',
            at: _5_SecondsFromNow
        }).then(function (result) {
            alert("Notification Set");

        cordova.plugins.notification.local.on("click", function (notification, state) {
        }, this)



var ionicApp = angular.module('starter', ['ionic', 'localNotificationModule']);$ionicPlatform) {
  $ionicPlatform.ready(function() {
    // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
    // for form inputs)
    if(window.cordova && window.cordova.plugins.Keyboard) {
    if(window.StatusBar) {

ionicApp.config(function($stateProvider, $urlRouterProvider) {
  .state('home', {
    url: '/',
    templateUrl: 'views/home.html'
  .state('feedback', {
    url: '/feedback',
    templateUrl: 'views/feedback.html'



I had the same issue registering my event listener in, and using $location.path(myurl) was only bringing up the home page of the app.

I ended solving my problem by using a simple

window.location.href = myurl;

I am storing the custom url in the data field, so my actual code was:

$rootScope.$on("$cordovaLocalNotification:click", function(notification, state) {
    var data = JSON.parse(;
    window.location.href = data.url;

Hello, is there a way to open a particular page on remote notifications? I have the possibility of giving parameters to my push.
Push messages are often sent in broadcast, but sometimes I need to redirect my users to more detailed pages.

in case of push i think you should check deep linking for push notifications. mostly all push notifications providers have deep linking feature.

Thanks a lot for the solution …

help ?