Home
Softono

Aapns

Open source Python
14
Stars
2
Forks
7
Issues
29
Watchers
3 years
Last Commit

 About Aapns

Asynchronous Apple Push Notifications

Platforms

Web Self-hosted iOS

Languages

Python

Need Help Installing Aapns?

We provide expert installation service for this software. Our team will install, configure, and secure Aapns on your server. plans start at just $30.

AAPNS

CircleCI Documentation Status

Asynchronous Apple Push Notification Service client.

  • Requires TLS 1.2 or better
  • Requires Python 3.8 or better

Quickstart

from aapns.api import Server
from aapns.config import Priority
from aapns.models import Notification, Alert, Localized

async def send_hello_world():
    client = await Server.production('/path/to/push/cert.pem').create_client()
    apns_id = await client.send_notification(
        'my-device-token',
        Notification(
            alert=Alert(
                body=Localized(
                    key='Hello World!',
                    args=['foo', 'bar']
                ),
            ),
            badge=42
        ),
        priority=Priority.immediately
    )
    print(f'Sent push notification with ID {apns_id}')
    await client.close()