Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

dirtyA/applepush

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

4 Commits

Repository files navigation

applepush

一个基于python2和http2的苹果推送SDK

安装

pip install applepush

使用


# coding:UTF-8
from applepush import ApplePush
apns = ApplePush('证书路径', 'bundle ID')
print apns.single_push('苹果设备token', "推送内容")

函数返回值


{
 'status': 成功为200,错误为其它,
 'headers': {
 'apns-id': 苹果推送返回的UUID,
 },
 'data': 苹果接口返回的字符串,
 'error_msg': 错误原因,如果推送成功为None
}
status请参考:https://developer.apple.com/library/prerelease/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.html#//apple_ref/doc/uid/TP40008194-CH11-SW15

打印帮助文档


from applepush import ApplePush
apns = ApplePush('证书路径', 'bundle ID')
apns.doc()

About

一个基于python2和http2的苹果推送SDK

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

Contributors

Languages

  • Python 100.0%

AltStyle によって変換されたページ (->オリジナル) /