Acknowledging the receipt of a push message

The Push Initiator can send a confirmed push message with application-level reliability that requires an acknowledgement from the push-enabled application. The push-enabled application can determine if it received a confirmed push message by checking the Boolean property isAckRequired from the PushPayload class. If the property is set to true, the push-enabled application must acknowledge the push message by either accepting or rejecting it using the acceptPush() or rejectPush() functions from the PushService class. For more information about these functions, see the API Reference.

The sample application checks the isAckRequired property when it calls the pushNotificationHandler() function. The sample application acknowledges the receipt of the push message by accepting it using the acceptPush() function.

// If an acknowledgement of the push is required (that is,
// the push was sent as a confirmed push), then you must either accept 
// or reject the push. A confirmed push is equivalent terminology to 
// the push being sent with application level reliability. 
if (pushPayload.isAckRequired) {
  // In our sample, we always accept the push, but situations might  
  // arise where an application might want to reject the push. For 
  // example, after looking at the headers that came with the push  
  // or the data of the push, we might decide that the push received  
  // did not match what we expected, and so we might want to reject 
  // the push.