0

Ich versuche lokale Benachrichtigung auf Phonegap zu verwenden. Ich benutze phonegap-Plugin-local-Benachrichtigung 1.0.1 "phonegap-Plugin-local-Benachrichtigung" und folgenden Code zu testen (auf dem Gerät Bereitschaftszustand):Lokale Benachrichtigung in Phonegap/Cordova

 if ("Notification" in window) { 
     Notification.requestPermission(function (permission) { 
      // If the user accepts, let's create a notification 
      if (permission === 'granted') { 
       var notification = new Notification("My title", { 
        tag: 'message1', 
        body: "My body" 
       }); 
       notification.onshow = function() { console.log('show'); }; 
       notification.onclose = function() { console.log('close'); }; 
       notification.onclick = function() { console.log('click'); }; 
      } 
     }); 
    } 

Was habe ich ist Benachrichtigung ist nicht in Fenster . Weiß jemand, wie man dieses plugin benutzt oder soll ich irgendetwas zu config.xml hinzufügen.

Oder gibt es eine andere Lösung lokale Benachrichtigung

Antwort

0

Versuchen Sie mit diesem plugin.Working gut für beide Android und Ios.

<plugin spec=" https://github.com/acianti/cordova-plugin-local-notifications.git" /> 
Verwandte Themen