Pr0Ger / Pyapns2
Licence: mit
Python library for interacting with the Apple Push Notification service (APNs) via HTTP/2 protocol
Stars: ✭ 246
Programming Languages
python
139335 projects - #7 most used programming language
Projects that are alternatives of or similar to Pyapns2
Apns2
⚡ HTTP/2 Apple Push Notification Service (APNs) push provider for Go — Send push notifications to iOS, tvOS, Safari and OSX apps, using the APNs HTTP/2 protocol.
Stars: ✭ 2,569 (+944.31%)
Mutual labels: apple, apns
dotAPNS
dotAPNS is a library used to send push notifications to Apple devices using Apple Push Notification service via HTTP/2 API.
Stars: ✭ 80 (-67.48%)
Mutual labels: apple, apns
node-apn-http2
Communicate with Apple Push Notification Service via native Node.js v8.8.1+ HTTP2 module (node-apn drop-in)
Stars: ✭ 25 (-89.84%)
Mutual labels: apple, apns
Jwt
Kotlin JWT 🔑 implementation (Json Web Token) as required by APNs 🔔 (Apple Push Notifications) or Sign in with Apple 🍏
Stars: ✭ 31 (-87.4%)
Mutual labels: apple, apns
Net Core Push Notifications
Lightweight .NET Core Push Notifications for Android and iOS
Stars: ✭ 105 (-57.32%)
Mutual labels: apple, apns
apns2
Node client for connecting to Apple's Push Notification Service using the new HTTP/2 protocol with JSON web tokens
Stars: ✭ 66 (-73.17%)
Mutual labels: apple, apns
Apnotic
A Ruby APNs HTTP/2 gem able to provide instant feedback.
Stars: ✭ 360 (+46.34%)
Mutual labels: apple, apns
Go Apns2
Go package for HTTP/2 Apple Push Notification Service.
Stars: ✭ 53 (-78.46%)
Mutual labels: apple, apns
Apns Http2
A Java library for sending notifications via APNS using Apple's HTTP/2 API.
Stars: ✭ 194 (-21.14%)
Mutual labels: apple, apns
React Native Header View
Fully customizable Header View with multiple design options for React Native.
Stars: ✭ 221 (-10.16%)
Mutual labels: apple
Hellosilicon
An attempt with ARM64 assembly on Apple Silicon Macs
Stars: ✭ 220 (-10.57%)
Mutual labels: apple
Bit Preserve
Project for capturing vintage, classic, aka old computer schematics in KiCad.
Stars: ✭ 219 (-10.98%)
Mutual labels: apple
Rules apple
Bazel rules to build apps for Apple platforms.
Stars: ✭ 217 (-11.79%)
Mutual labels: apple
PyAPNs2
Python library for interacting with the Apple Push Notification service (APNs) via HTTP/2 protocol
Installation
Either download the source from GitHub or use pip:
$ pip install apns2
Sample usage
from apns2.client import APNsClient
from apns2.payload import Payload
token_hex = 'b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b87'
payload = Payload(alert="Hello World!", sound="default", badge=1)
topic = 'com.example.App'
client = APNsClient('key.pem', use_sandbox=False, use_alternative_port=False)
client.send_notification(token_hex, payload, topic)
# To send multiple notifications in a batch
Notification = collections.namedtuple('Notification', ['token', 'payload'])
notifications = [Notification(payload=payload, token=token_hex)]
client.send_notification_batch(notifications=notifications, topic=topic)
# To use token based authentication
from apns2.credentials import TokenCredentials
auth_key_path = 'path/to/auth_key'
auth_key_id = 'app_auth_key_id'
team_id = 'app_team_id'
token_credentials = TokenCredentials(auth_key_path=auth_key_path, auth_key_id=auth_key_id, team_id=team_id)
client = APNsClient(credentials=token_credentials, use_sandbox=False)
client.send_notification_batch(notifications=notifications, topic=topic)
Further Info
iOS Reference Library: Local and Push Notification Programming Guide
Contributing
To develop PyAPNs2, check out the code and install dependencies. It's recommended to use a virtualenv to isolate dependencies:
# Clone the source code.
git clone https://github.com/Pr0Ger/PyAPNs2.git
cd PyAPNs2
# Create a virtualenv and install dependencies.
virtualenv venv
. venv/bin/activate
pip install -e .[tests]
To run the tests:
pytest
You can use tox
for running tests with all supported Python versions:
pyenv install 3.5.6; pyenv install 3.6.7; pyenv install 3.7.1; pyenv install 3.8.0
pyenv local 3.8.0 3.7.1 3.6.7 3.5.6
pip install tox
tox
To run the linter:
pip install pylint
pylint --reports=n apns2 test
License
PyAPNs2 is distributed under the terms of the MIT license.
See LICENSE file for the complete license details.
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].