Skip to main content

Send requests to Apple Push Notification service (APNs) to push notifications to users.

Project description

pyAPNsKit

Send requests to Apple Push Notification service (APNs) to push notifications to users via HTTP/2, token-based

pip install pyAPNsKit

Get Started

Quickly push information to devices

from pyAPNsKit import apns

p8key=""
with open('AuthKey_KeyID.p8','r') as p8file:
    p8key=p8file.read()
client=apns.Client("teamID","App_BundleID","KeyID",p8key)
isSuccess=client.sendAlert('deviceID','title','subtitle','message',sound=True)

[!NOTE]

For parameters, their acquisition methods, and instructions, please refer to the Apple Developer Document

Customized

from pyAPNsKit import apns,APNsHeader,APNsBody,types

p8key=""
with open('AuthKey_KeyID.p8','r') as p8file:
    p8key=p8file.read()

apnsHeader=APNsHeader.APNsHeader("teamID","topic","KeyID",p8key,types.PushType.alert)
isSuccess=apns.pushByDeviceToken('deviceID',
               apnsHeader
                .withAPNsCollapse('Collapse')
               ,
               APNsBody.APNsBody()
                .withAlert("title","sub","message")
                .withSound()
             # ,isSandbox=True
)

Project details


Download files

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

Source Distribution

pyapnskit-0.1.2.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyapnskit-0.1.2-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file pyapnskit-0.1.2.tar.gz.

File metadata

  • Download URL: pyapnskit-0.1.2.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyapnskit-0.1.2.tar.gz
Algorithm Hash digest
SHA256 1ced2ac071c266221fe15699fa4d90662c8b69ba4cf661edf98d172ddf5b5063
MD5 8b6691e263f9a53f0c117a0b143c5d39
BLAKE2b-256 5bc6a48f4d829da77c6f3d79391e43bdc59a10d9718961584bc092beb276e9fe

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyapnskit-0.1.2.tar.gz:

Publisher: python-publish.yml on guoPhineas/pyAPNsKit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyapnskit-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: pyapnskit-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyapnskit-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0b4974814ccfc08ee4b195b9720e475480b3b2b8290d3c312357581b69479990
MD5 7a19d6ecc71e698bb7fc74c64abf70e9
BLAKE2b-256 c66cd88af27eb877c437dbe0133e2b35bc4b54b467aa0fb70a4e7261abeb9e8d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyapnskit-0.1.2-py3-none-any.whl:

Publisher: python-publish.yml on guoPhineas/pyAPNsKit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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