Skip to main content
# apns2-client

apns2-client is a python package designed for simple, flexible and fast Apple Push Notifications on iOS, OSX and Safari using the new HTTP/2 Push provider API.

Creation of this package was inspired by @sideshow's [apns2](https://github.com/sideshow/apns2) golang package.

## Features

- Uses new Apple APNs HTTP/2 connection
- Supports new iOS 10 features such as Collapse IDs, Subtitles and Mutable Notifications
- Supports persistent connections to APNs

## Cautions

- Works only with Python 3.5 and later

## Install

- Make sure you have [pip](https://pip.pypa.io/en/stable/installing/) installed.
- Install `apns2-client`:

```sh
pip install apns2-client
```

## Example

```python
import apns2


cli = apns2.APNSClient(mode="dev", client_cert="/your/path.pem")
alert = apns2.PayloadAlert(body="body!", title="title!")
payload = apns2.Payload(alert=alert)
n = apns2.Notification(payload=payload, priority=apns2.PRIORITY_LOW)
response = cli.push(n=n, device_token="your_token")
assert response.status_code == 200, response.reason
assert response.apns_id
```

Metadata

Release files for apns2-client 0.5.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for apns2-client 0.5.4
File Size Uploaded Provenance
apns2-client-0.5.4.tar.gz 6.4 kB Without provenance Details

Release files / apns2-client-0.5.4.tar.gz

Download URL apns2-client-0.5.4.tar.gz
Size 6.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4a65c9ca0e3333c1db69ad257aa186fd26ef90621a985e1958bfd54e3ad57c7d
BLAKE2b-256 checksum
How to use checksums
57db9115f28305c7e26a0bcebf95d705f9ef563371f460624043c766cf63ee8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for apns2-client 0.5.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page