Skip to main content

Asynchronous Apple Push Notification Service Client

Project description

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()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

aapns-20.8-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

Details for the file aapns-20.8-py3-none-any.whl.

File metadata

  • Download URL: aapns-20.8-py3-none-any.whl
  • Upload date:
  • Size: 16.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.5

File hashes

Hashes for aapns-20.8-py3-none-any.whl
Algorithm Hash digest
SHA256 d48d5a344ed049533b9d21575cbcd8219e1b5b36a75e6ee592a62afb839c6ab9
MD5 54278ea7e771242ee8782137163446db
BLAKE2b-256 743b3d66e01c681e284b2b9861df94f3f6eaa40068489eae49e857d4a034cd36

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page