I trying to set local Notification for my ionic cordova app , but when i click on the redirect to home page does not work : this is my controller :
app.controller('notificationCtrl', function($scope, $rootScope, $ionicPlatform, $cordovaLocalNotification, $state){
$scope.add = function() {
var alarmTime = new Date();
alarmTime.setMinutes(alarmTime.getMinutes() + 1);
$cordovaLocalNotification.add({
id: 1,
date: alarmTime,
message: "Bonjour",
title: "nouvelle commande",
autoCancel: true,
sound: null
}).then(function () {
alert("The notification has been set");
});
};
$rootScope.$on('$cordovaLocalNotification:click',
function (event, notification, state) {
$state.go('home');
alert('ok then ');
});
});