Flask-Pushjack
Flask extension for push notifications on APNS (iOS) and GCM (Android).
Links
Documentation: http://flask-pushjack.readthedocs.org
Quickstart
Whether using APNS or GCM, Flask-Pushjack provides an API client for each.
APNS
from flask import Flask
from flask_pushjack import FlaskAPNS
config = {
'APNS_CERTIFICATE': '<path/to/certificate.pem>'
}
app = Flask(__name__)
app.config.update(config)
client = FlaskAPNS()
client.init_app(app)
with app.app_context():
token = '<device token>'
# Send to single device.
res = client.send(token, alert, **options)
# List of all tokens sent.
res.tokens
# List of any subclassed APNSServerError objects.
res.errors
# Dict mapping token => APNSServerError.
res.token_errors
# Send to multiple devices.
client.send([token], alert, **options)
# Get expired tokens.
expired_tokens = client.get_expired_tokens()
GCM
from flask import Flask
from flask_pushjack import FlaskGCM
config = {
'GCM_API_KEY': '<api-key>'
}
app = Flask(__name__)
app.config.update(config)
client = FlaskGCM()
client.init_app(app)
with app.app_context():
token = '<device token>'
# Send to single device.
res = client.send(token, alert, **options)
# List of requests.Response objects from GCM Server.
res.responses
# List of messages sent.
res.messages
# List of registration ids sent.
res.registration_ids
# List of server response data from GCM.
res.data
# List of successful registration ids.
res.successes
# List of failed registration ids.
res.failures
# List of exceptions.
res.errors
# List of canonical ids (registration ids that have changed).
res.canonical_ids
# Send to multiple devices.
client.send([token], alert, **options)
For more details, please see the documentation for pushjack at http://pushjack.readthedocs.org.
Configuration
APNS
APNS_CERTIFICATE |
File path to certificate PEM file (must be set). Default: None |
APNS_ENABLED |
Whether to enable sending. Default True |
APNS_SANDBOX |
Whether to use sandbox server. Default: False |
APNS_DEFAULT_ERROR_TIMEOUT |
Timeout when polling APNS for error after sending. Default: 10 |
APNS_DEFAULT_EXPIRATION_OFFSET |
Message expiration (secs) from now. Default: 2592000 (1 month) |
APNS_DEFAULT_BATCH_SIZE |
Number of notifications to group together when sending. |
GCM
GCM_API_KEY |
API key (must be set). Default: None |
GCM_ENABLED |
Whether to enable sending. Default True |
Metadata
Release files for Flask-Pushjack 1.0.0
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 |
|---|---|---|---|---|
| Flask-Pushjack-1.0.0.tar.gz | 5.6 kB | Without provenance | Details for Flask-Pushjack-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| Flask_Pushjack-1.0.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for Flask_Pushjack-1.0.0-py2.py3-none-any.whl |
Total release size: 12.4 kB
Release files / Flask-Pushjack-1.0.0.tar.gz
| Download URL | Flask-Pushjack-1.0.0.tar.gz |
|---|---|
| Size | 5.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
86863dbab7367a8be81dab8804aaa8052e58602f5f57f3309341eec9dc9dcde0
|
|
BLAKE2b-256 checksum How to use checksums |
e7185867bb12f9357ed4988d8c7b09f8a2a5b5cdb68780cd3627649e361e9592
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / Flask_Pushjack-1.0.0-py2.py3-none-any.whl
| Download URL | Flask_Pushjack-1.0.0-py2.py3-none-any.whl |
|---|---|
| Size | 6.7 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
78b0f3a36a3046c8b2e31d4b180867f4ee97adfb002c2ac887668c3f9bb8702a
|
|
BLAKE2b-256 checksum How to use checksums |
94982f6ee064c05ca7be1d8b64d695ffd221b724d5dd9143178f9fafee55a796
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for Flask-Pushjack 1.0.0
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.