Search code examples
androidioscordovapush-notificationibm-mobilefirst

How can i handle push notification in IMF8?


I am developing an application using cordova and ibm mobile first 8 and wanted to integrate a push notification system. I registre the device in the server and i can send the notification from the server to client app then the client app handle a received push notification by operating on its response object in the registered callback function :

var notificationReceived = function(message) {
alert(JSON.stringify(message));
};

Here is my issues : alert issues

I don't want the alert to be displayed. And I want that when I click on the notification A function is called.

how can i do this ? Please i need your help thanks .


Solution

  • In the code snippet you have in your question there is an alert. Remove the alert snippet and no alert dialog will be displayed...

    You can then put there instead anything else you'd like, like logging the notification contents, or performing any other action, like calling a function.

    var notificationReceived = function(message) {
    myFunction();
    };
    
    function myFunction() {
        ...
    }