Local notification onclick not called

I am using the local notification plugin https://github.com/katzer/cordova-plugin-local-notifications.git

window.plugin.notification.local.onclick works fine if I stay on the same page, but if I move to another page, window.plugin.notification.local.onclick is not being called.

Any idea what am I doing wrong?

Hervé

document.addEventListener(‘deviceready’, function () {
// window.plugin.notification.local is now available
window.plugin.notification.local.onclick = function (id, state, json) {
if(id === ‘Odean’)
{
window.location.href = ‘#/tab/offers-bpage/0’;
}
else if(id === ‘Black Horse Pub’)
{
window.location.href = ‘#/tab/offers-bpage/1’;
}
else if(id === ‘M&S’){
window.location.href = ‘#/tab/offers-bpage/2’;
}
}
}, false);

its works see those code

Unfortunately not, its not that easy.