Callouts and Push Notifications

In addition to the APNs and GCM callouts, there are callouts directly related to push notifications. These callouts are all applicable to managing Google Push notifications (and MM7 message types). The generic_delivery_msg_dispose callout can also be used with APNs.

You can use the generic_delivery_msg_dispose callout for Google or Apple push notifications and for MM7 message types. Note that the value of "DLV_Response_Status" depends upon the protocol used. Inspect the context variable DLV_Response_Status using the msg:context_get function. In the context of a GCM notification, this variable gives you the value of the GCM error status. If it is an empty string, then no error occurred. You can use msys.gcm.gcm_classify_error to determine the classification of "DLV_Response_Status". This function translates the protocol-specific error code to either a permanent or a temporary failure. For a list of Google error codes see GCM Status Codes . See Apple Status Codes for APNs error codes.

The DLV_Response_Status variable is referenced in “generic_delivery_msg_dispose example”. Note that an empty DLV_Response_Status variable indicates a successful message delivery. All the context variables related to push notifications are as follows:

DLV_Source_ID – The ID, this is protocol-specific.

DLV_Dest_Addr – The "to" address.

DLV_Dest_ID – This variable is protocol-specific. For GCM it is the registration ID and for APNs it is the device token.

DLV_Transaction_ID – This is protocol-specific and applies only to the APNs identifier.