Show TOC

checkForNotification( callback ) methodLocate this document in the navigation structure

This method checks for any notifications received while the application was not running in the foreground.

Application developer can call this function directly or register with an event handler to be called automatically. It is ok to call this function evenif the device is not yet registered for push notification.

Syntax

<static> checkForNotification( callback )

Parameters
Name Type Description
<callback> function The callback function that receives the notification.The callback function will receive a string as it's argument. This string will contain the notification message send from the server intact.
Example
function processBackgroudMessage(mesg){
 
}
function checkBackgroundNotification() {
    sap.Push.checkForNotification(processBackgroudMessage);
}
document.addEventListener("onSapLogonSuccess", checkBackgroundNotification, false);
document.addEventListener("onSapResumeSuccess", checkBackgroundNotification, false);