2017-06-21 5 views
0

Ich versuche, das Push-Benachrichtigungs-Plugin in ionic1 zu integrieren.Uncaught ReferenceError: PushNotification ist nicht definiert

Ich folgte diesem Tutorial

http://ngcordova.com/docs/plugins/pushNotificationsV5/ 

I-Plugin erfolgreich installiert. Wenn ich Token zu dieser Zeit zu bekommen versuche ich einen Fehler

Uncaught ReferenceError: PushNotification is not defined(…) 

bin Gettin ich glaube, ich etwas falsch mache.

Antwort

0

Direkt unter Code in Ihre app.js setzen

$ionicPlatform.ready(function() {  
    var options = { 
    android: { 
     senderID: "*********" 
    }, 
    ios: { 
     alert: "true", 
     badge: "true", 
     sound: "true" 
    }, 
    windows: {} 
    }; 

    // initialize 
    $cordovaPushV5.initialize(options).then(function() { 
    $cordovaPushV5.register().then(function(registrationId) { 
     console.log("tokenid",registrationId); 
    }); 
    }); 
}); 
Verwandte Themen