kalyke
A library for interacting with APNs and VoIP using HTTP/2.
Installation
kalyke requires python 3.6 or later.
$ pip install kalyke-apns
Usage
APNs
from kalyke.client import APNsClient
from kalyke.payload import PayloadAlert, Payload
payload_alert = PayloadAlert(title="YOUR TITLE", body="YOUR BODY")
alert = Payload(alert=payload_alert, badge=1, sound="default")
client = APNsClient(
team_id="YOUR_TEAM_ID", auth_key_id="AUTH_KEY_ID", auth_key_filepath="/path/to/AuthKey_AUTH_KEY_ID.p8",
bundle_id="com.example.App", use_sandbox=True, force_proto="h2"
)
# or background push
"""
client = APNsClient(
team_id="YOUR_TEAM_ID", auth_key_id="AUTH_KEY_ID", auth_key_filepath="/path/to/AuthKey_AUTH_KEY_ID.p8",
bundle_id="com.example.App", use_sandbox=True, force_proto="h2", apns_push_type="background"
)
"""
# Send single push notification
registration_id = "a8a799ba6c21e0795b07b577b562b8537418570c0fb8f7a64dca5a86a5a3b500"
result = client.send_message(registration_id, alert)
# Send multiple push notifications
registration_ids = [
"87b0a5ab7b91dce26ea2c97466f7b3b82b5dda4441003a2d8782fffd76515b73",
"22a1b20cb67a43da4a8f006176788aa20271ac2e3ac0da0375ae3dc1db0de210"
]
results = client.send_bulk_message(registration_ids, alert)
VoIP
from kalyke.client import VoIPClient
client = VoIPClient(
auth_key_filepath="/path/to/YOUR_VOIP_CERTIFICATE.pem",
bundle_id="com.example.App.voip", use_sandbox=True
)
alert = {
"key": "value"
}
# Send single VoIP notification
registration_id = "14924adeeabaacc8b38cfd766965abffd0ee572a5a89e7ee26e6009a3f1a8e8a"
result = client.send_message(registration_id, alert)
# Send multiple VoIP notifications
registration_ids = [
"84b7120bf190d171ff904bc943455d6081274714b32c486fa28814be7ee921fb",
"afaa8dcedc99d420e35f7435edad4821dbad3c8c7d5071b2697da9bd7a5037ad"
]
results = client.send_bulk_message(registration_ids, alert)
Todo
- Tests
License
This software is licensed under the MIT License (See LICENSE).
Metadata
Release files for kalyke-apns 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| kalyke-apns-0.1.5.tar.gz | 9.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| kalyke_apns-0.1.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.6 kB
Release files / kalyke-apns-0.1.5.tar.gz
| Download URL | kalyke-apns-0.1.5.tar.gz |
|---|---|
| Size | 9.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
da3060d3a4e2a978228a84326476def5269cb78c5a8515b63ebfd25902e7ec44
|
|
BLAKE2b-256 checksum How to use checksums |
e3d1dd7ba133e4286261b2ab0cd4ad2d7333c01552139ddac870dabc44355b0b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.5 CPython/3.9.5 Linux/5.4.0-1047-azure
|
Release files / kalyke_apns-0.1.5-py3-none-any.whl
| Download URL | kalyke_apns-0.1.5-py3-none-any.whl |
|---|---|
| Size | 8.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2054413e4be67ae575e9cc12c88617dc24014dba23cc8f7dac586ad4708dc1f1
|
|
BLAKE2b-256 checksum How to use checksums |
b4c58206ea3270048fe2557c1128697715efbd9a93ea16c1d5a143767b83f7ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.5 CPython/3.9.5 Linux/5.4.0-1047-azure
|
Security for kalyke-apns 0.1.5
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.