kalyke
A library for interacting with APNs and VoIP using HTTP/2.
Installation
kalyke requires python 3.9 or later.
$ pip install kalyke-apns
Usage
APNs
import asyncio
from kalyke import ApnsClient, ApnsConfig, Payload, PayloadAlert
client = ApnsClient(
use_sandbox=True,
team_id="YOUR_TEAM_ID",
auth_key_id="AUTH_KEY_ID",
auth_key_filepath="/path/to/AuthKey_AUTH_KEY_ID.p8",
)
registration_id = "a8a799ba6c21e0795b07b577b562b8537418570c0fb8f7a64dca5a86a5a3b500"
payload_alert = PayloadAlert(title="YOUR TITLE", body="YOUR BODY")
payload = Payload(alert=payload_alert, badge=1, sound="default")
config = ApnsConfig(topic="com.example.App")
asyncio.run(
client.send_message(
device_token=registration_id,
payload=payload,
apns_config=config,
)
)
LiveActivity
import asyncio
from datetime import datetime
from kalyke import LiveActivityClient, LiveActivityApnsConfig, LiveActivityEvent, LiveActivityPayload, PayloadAlert
client = LiveActivityClient(
use_sandbox=True,
team_id="YOUR_TEAM_ID",
auth_key_id="AUTH_KEY_ID",
auth_key_filepath="/path/to/AuthKey_AUTH_KEY_ID.p8",
)
registration_id = "a8a799ba6c21e0795b07b577b562b8537418570c0fb8f7a64dca5a86a5a3b500"
payload_alert = PayloadAlert(title="YOUR TITLE", body="YOUR BODY")
payload = LiveActivityPayload(
alert=payload_alert,
badge=1,
sound="default",
timestamp=datetime.now(),
event=LiveActivityEvent.UPDATE,
content_state={
"currentHealthLevel": 100,
"eventDescription": "Adventure has begun!",
},
)
config = LiveActivityApnsConfig(
topic="com.example.App.push-type.liveactivity",
)
asyncio.run(
client.send_message(
device_token=registration_id,
payload=payload,
apns_config=config,
)
)
VoIP
import asyncio
from pathlib import Path
from kalyke import VoIPApnsConfig, VoIPClient
client = VoIPClient(
use_sandbox=True,
auth_key_filepath=Path("/") / "path" / "to" / "YOUR_VOIP_CERTIFICATE.pem",
)
registration_id = "a8a799ba6c21e0795b07b577b562b8537418570c0fb8f7a64dca5a86a5a3b500"
payload = {"key": "value"}
config = VoIPApnsConfig(
topic="com.example.App.voip",
)
asyncio.run(
client.send_message(
device_token=registration_id,
payload=payload,
apns_config=config,
)
)
License
This software is licensed under the MIT License (See LICENSE).
Metadata
Release files for kalyke-apns 1.0.2
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 | Actions |
|---|---|---|---|---|
| kalyke_apns-1.0.2.tar.gz | 9.8 kB | Without provenance | Details for kalyke_apns-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| kalyke_apns-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for kalyke_apns-1.0.2-py3-none-any.whl |
Total release size: 23.1 kB
Release files / kalyke_apns-1.0.2.tar.gz
| Download URL | kalyke_apns-1.0.2.tar.gz |
|---|---|
| Size | 9.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ba6427a4812cb54d11c150dbf42ac8668159c540ebf1f47dfc39ccaee4c15d9e
|
|
BLAKE2b-256 checksum How to use checksums |
776ddf105008647e272bc1dc0037663d33d0cb768bc8d3672c0c406f0018696a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.12.1 Linux/6.2.0-1018-azure
|
Release files / kalyke_apns-1.0.2-py3-none-any.whl
| Download URL | kalyke_apns-1.0.2-py3-none-any.whl |
|---|---|
| Size | 13.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
43f32d27b709a421bc40b28593a5573289842367bd37c2b22596be3b9c0273fb
|
|
BLAKE2b-256 checksum How to use checksums |
7d5e9bd8a5de94afe30df1d31ad306df86bc7eecfb3fbf7a8503958de2f712a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.12.1 Linux/6.2.0-1018-azure
|
Security for kalyke-apns 1.0.2
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.