Skip to content

A Python client for Apple Push Notification service(APNs)

License

Notifications You must be signed in to change notification settings

leiyu0918/apns-python

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

apns-python package

Demonstration

from apns_python import Alert, APS, Payload, Headers, Client


alert = Alert(
    title='Notification Title',
    body='A preview content from apn-python')

aps = APS(
    alert=alert,
    badge=1,
    sound='sound.mp3')

payload = Payload(
    aps=aps,
    custom_fields=dict(
        customized_field='some data'))

headers = Headers(
    custom_fields={"Content-Type": "application/json; charset=utf-8"})

CHEM_APNS_CLIENT = Client(
    push_mode='dev',
    secure=True,
    cert_location='/your/apns/certfile.pem',
    cert_password='APNsCertPassword')

result = client.send(device_token, headers, payload)

print result
'''

About

A Python client for Apple Push Notification service(APNs)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%