I'm handling Toast Notifications on Windows Phone 8.1 app (using HTML/JS,CSS) when user click on notifications(On action bar) with the following code snippet: Reference: https://msdn.microsoft.com/en-us/library/windows/apps/hh761468.aspx
WinJS.Application.addEventListener("activated", onActivatedHandler, false);
function onActivatedHandler(args) {
if (args.detail.kind === Windows.ApplicationModel.Activation.ActivationKind.launch) {
localStorage.messageDetails = args.detail.arguments;
window.location.href = "index.html";
}
}
It works well when the app is running in foreground or background. But, when I click on notifications, it is not hitting the above code snippet when the app is not running (foreground or background). I don't know what I'm doing wrong. Please help me on this. Thanks in advance.