fork from PyAPNS
https://github.com/simonwhitaker/PyAPNs