Push notifications not captured and displayed when app is paused/suspended (Android)

I’m trying to get push notifications to appear in the top bar in Android when the app is suspended.

Notifications process fine while the app is in the foreground, but as soon as the app is paused or not running, they never get caught.

Here’s the raw JSON of the notification:

{“event”:“message”,“from”:“XXXXXXXXXX”,“collapse_key”:“do_not_collapse”,“foreground”:true,“payload”:{“alert”:“Hello World!”,“badge”:“7”,“sound”:“sound.caf”}}

Here’s the app code that captures the notifications:

window.onNotification = function (e) {
switch (e.event) {
case ‘registered’:
if (e.regid.length > 0) {
console.log("Your regID is : " + e.regid);

            var userId = window.localStorage.getItem("UserIdToken").replace(/"/g, "");
            var data = new Object();
            data.UserId = userId;
            data.PushNotificationRegId = e.regid;
        }
        break;
    case 'message':
        // this is the actual push notification. its format depends on the data model     from the push server
        console.log('message = ' + JSON.stringify(e));
        var elem = angular.element(document.querySelector('[ng-app]'));
        var rootScope = elem.injector().get('$rootScope');
        rootScope.$broadcast('pushNotificationReceived', e);
        break;
    case 'error':
        //console.log('GCM error = ' + e.msg);
        alert('GCM error = ' + e.msg);
        break;
    default:
        //console.log('An unknown GCM event has occurred');
        alert('An unknown GCM event has occurred');
        break;
}

};

did u get solution ? please help me too