Search code examples
androidmobilegoogle-cloud-messagingibm-mobilefirst

Mobile First - Not getting any Notifications but get .onMessage Alert


Hello I am trying to set up Push Notifications through Mobile First 7.1 HYBRID APPLICATION.

I am able to subscribe and submit notifications however the notifications are not appearing on my phone.

But the 'onMessage' Alert is appearing as if I had received the notification.

I am using the example Broadcast & Tag Notification Example from here.

Push Notification Number of Messages that have been sent using Broadcast & Tag

This is the function that is displaying on my phone:

WL.Client.Push.onMessage = function (props, payload) {
    WL.SimpleDialog.show("Tag Notifications", "Provider notification data: " + JSON.stringify(props), [ {
        text : 'Close',
        handler : function() {
            WL.SimpleDialog.show("Tag Notifications", "Application notification data: " + JSON.stringify(payload), [ {
                text : 'Close',
                handler : function() {}
              }]);      
        }
    }]);
};

Why am I not receiving the actual notifications?


Solution

  • If the alert from the oneMessage method is displaying that you have received the push notification.

    It is unclear from your question if the contents of the notification if displaying within the alert or not. Review your question and edit it to properly describe your problem.

    If you mean that the notification are not appearing in the notification center of your Android device - then note that they will appear there only if the application is close, that is - not running in the foreground, or closed completely (quit).