question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Local notification onclick issue

See original GitHub issue

Hi thanks for this great plugin… i have installed the local notification by command line and all work perfectly i received the notification but i cant make a redirection to a specific page when i clicked on the notification it redirect me to the current page instead of my specific page this my code

$.ajax({


type: "POST",
url: "http://******/~my/path/send_filter.php",

data:   
        "&classes="+all_classes+
        "&states="+all_states+
        "&titres="+all_titres+
        "&autheurs="+all_autheur+
        "&id="+id,

dataType: "json",

cache: false,


beforeSend: function(){ $("#send_filter").val('Enregistrement...');},

success: function(data) {

    if(data)
    {
        if (data.msg=="ok") {

            $("#send_filter").val('ok');

         var id        = window.localStorage.getItem('id');
         var url       = "http://*****/~mypath/my path/get_notify_alerts.php?id="+id;

        document.addEventListener('deviceready', function () {


        $.getJSON(url,function(json){

                id_notify   = json.notify.id;
                updater     = json.notify.date;
                msg_alert   = "Resultat d'Alert de filtre";

            window.plugin.notification.local.add({
                id:      "1",
                title:   "TM",
                message: msg_alert,
                });

              });


            window.plugin.notification.local.onclick = function (id, state, json) 
                    {
                         location.href="index.html";
                    };

            });


        };

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:21 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
mindnervestechcommented, Sep 4, 2019

Not working for me also when click on notification. Is there any solution?

2reactions
owen2345commented, Dec 14, 2017

@OctoberCat I tested in ios and click is not calling the callback, check my code:

this.localNotifications.on('click', (notification, state) => {
      console.log("clickeeddddd: ", notification, state);
      alert("clickkkedddd: ")
    });
Read more comments on GitHub >

github_iconTop Results From Across the Web

Not able to set Ionic Local Notification On Click Event (weird ...
Here is my full home.ts code: Note- I am calling the submit function from home.html. Notifications are working perfectly and triggered on time....
Read more >
Local notification onclick not called - Ionic Forum
I am using the local notification plugin ... window.plugin.notification.local.onclick works fine if I stay on the same page, ...
Read more >
Notification: click event - Web APIs - MDN Web Docs - Mozilla
The click event of the Notification interface fires when the user clicks on displayed Notification.
Read more >
Create a Notification - Android Developers
Notifications provide short, timely information about events in your app while it's not in use. This page teaches you how to create a...
Read more >
925892 - Clicking on local notification in notification ... - Monorail
Steps to reproduce the problem: 1. Receive 2+ local notifications. Correct behaviour when: 2. From the action centre, click on the most recent...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found