Skip to content

etataurov/asyncio-apns

Repository files navigation

asyncio-apns

Build Status Coverage Status

asyncio client for Apple Push Notification Service

Work in progress

Installation

git clone https://github.com/etataurov/asyncio-apns
cd asyncio-apns
pip install -e .

Usage

import asyncio

from asyncio_apns import connect

CERT_FILE = 'path/to/cert_file'
KEY_FILE = 'path/to/key_file'

async def send_push(message, token, loop):
    apns = await connect(CERT_FILE, KEY_FILE, loop=loop)
    await apns.send_message(message, token)
    apns.disconnect()

message = 'Hello World!'
token = 'YOUR_DEVICE_TOKEN'

loop = asyncio.get_event_loop()
loop.run_until_complete(send_push(message, token, loop))
loop.close()

About

asyncio client for Apple Push Notification Service

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published