nomad/houston — pull request #56 by sideshow (2014-06-16 23:36:28+00:00)
Title: Fix token binary length

Explicitly sets the token length to 32 bytes according to Apple Documentation as opposed to variable length.

We couldn't work out why we were intermittently and infrequently an getting error code 4 (missing payload) back from APNS as we knew were were sending a JSON payload.

This fixes an issue where if you create a payload with an invalid length token and send it to the APNS you may get back an error code 4 because the APNS gets the offset of the payload incorrect and unpacks invalid JSON.

In theory you shouldn't send crappy tokens to APNS, however if you do this fix ensures that you will get back the correct error code 8 (Invalid token).