nomad-cli / houston

Apple Push Notifications; No Dirigible Required
http://nomad-cli.com
MIT License
2.93k stars 229 forks source link

How Does Houston Encode Push Tokens? #145

Closed bennettl closed 5 years ago

bennettl commented 7 years ago

Here's an example of a push token I pass to Houston 2d03c5c2a6e0c47a4cba1de0738ee887. I was wondering how exactly does houston encodes this to a valid 32 byte push token? I need to have a valid push token to further debug an issue I'm having. Looking through the source code i see the line [1, 32, @token.gsub(/[<\s>]/, '')].pack('cnH64'). Is this how it's done?

dankimio commented 5 years ago

Yes. It returns the binary representation of the device token. More about pack here. Another example in the other library.