PushPlugin callback not called


I am using PushPlugin to handle push notifications. I am able to get device token and receive the notifications but the callback function is not being called. Here’s my service code:

'use strict';
 .factory('Notification', function (Device) {

var pushNotification;  

var tokenHandler = function(result){

var errorHandler = function(err){
  alert('error = ' + err);

var onNotification = function(event){
console.log("ON NOTIFICATION: " + JSON.stringify(event))
if ( event.alert )

if ( event.sound )
 //badge update is handled here...

return {
   init: function(){
   pushNotification = window.plugins.pushNotification;
   if (!Device.isPushTokenSet()){
        "badge": "true",
        "sound": "true",
        "alert": "true",
        "ecb": "onNotification"
 }, //init


The ‘onNotification’ above never gets called. What am I missing here?




What platform ?

Did you try to send push with app in background ? ( with logs at the same time )


This worked for me !


rdb thanks for the reply but it still does not work for me. I see the logs by PushPlugin.m and AppDelegate.m but my service callback is not being called. I’ve tried both foreground and background.


Try to :

name your ecb ‘window.onNotification’ and rename your function like this :

window.onNotification = function(event) {

My code is like this but in a controller.


That works; thanks a lot for your help