apns-python-wrapper 设备令牌问题

发布于 2024-09-07 20:03:17 字数 454 浏览 1 评论 0原文

要在此处使用模块 apns-python-wrapper:http://code.google。 com/p/apns-python-wrapper/ 你需要转换你的iPhone的APNS设备令牌,但是,我不知道如何转换它。

这是从设备返回的新令牌:8fa9c60685c158a3cf6f9c5de164b3817e68a075fcfdafcd982aa4b3d2ca99c7

这就是它需要的样子: Qun\xaa\xd4R\x11zu\x07\x04\x9dG\xe6\x96j&\x95Y\x9d\x91~\xcc`z\n\x88O\xc0\x9c\xf6\xca

请注意,这不是直接转换。关于如何在 Python 中将第一个标记转换为第二个标记有什么想法吗?

To use the module apns-python-wrapper here: http://code.google.com/p/apns-python-wrapper/ you need to convert your iPhone's APNS device token, however, I'm not sure how to convert it.

Here is the fresh new token returned from the device: 8fa9c60685c158a3cf6f9c5de164b3817e68a075fcfdafcd982aa4b3d2ca99c7

And this is what it needs to look like:
Qun\xaa\xd4R\x11zu\x07\x04\x9dG\xe6\x96j&\x95Y\x9d\x91~\xcc`z\n\x88O\xc0\x9c\xf6\xca

Note that is not a direct conversion. Any idea on how to convert the first token to the second in Python?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

此岸叶落 2024-09-14 20:03:17

使用 tokenHex(yourDeviceToken) 方法而不是 token(yourDeviceToken) 它应该可以正常工作。我遇到了同样的问题,当我更改方法时,它在该方法内进行了转换。

Use the tokenHex(yourDeviceToken) method instead of token(yourDeviceToken) and it should work fine. I had the same problem and when I changed the method, it did the conversion inside this method.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文