The APNS class / com.APNS methods |
Decodes content of BYTE data returned from the APNS server in case of error.
com.APNS.DecodeError( data BYTE) RETURNING uuid STRING, error INTEGER
This method decodes the content of the BYTE variable passed as a parameter and received as response for a push notification message in the event of an error from the APNs server.
The uuid is a binary value that identifies the push notification message. It is returned as a Base64-encoded string.
The error returned value defines the APNs error code. For example, error will be set to 10 if the APNs server was shutdown. See the Apple Push Notification Service error reference for more details.
In the case of a decoding error, the method will raise the exception -15566, with details in the SQLCA.SQLERRM register.
DEFINE error_data BYTE, uuid STRING, error INTEGER LOCATE error_data IN MEMORY -- Send push notification message TCP request ... CALL req.doDataRequest(data) LET resp = req.getResponse() TRY CALL resp.getDataResponse(error_data) CALL com.APNS.DecodeError(error_data) RETURNING uuid, ecode ...
For a complete example, see APNs push provider.