Acknowledging the receipt of a push message

The Push Initiator can send a confirmed push message with application-level reliability. The push-enabled application must acknowledge a confirmed push message. The push-enabled application can determine if it received a confirmed push message by checking the Boolean field isAcknowledgeRequired from the PushPayload object. If the property is set to true, the push-enabled application must acknowledge the push message by either accepting it by calling pushpayload.acknowledge(true) or rejecting it by calling pushpayload.acknowledge(false). For more information about these functions, see the API Reference.

The sample application checks the isAcknowledgeRequired field when it calls pushNotificationHandler(). The sample application acknowledges the receipt of the push message by accepting it by calling pushpayload.acknowledge(true).

// 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.isAcknowledgeRequired) {
   // 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.
   pushpayload.acknowledge(true);
}

Last modified: 2014-10-09



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus