For sending push notifications to android and ios devices
Project description
knok_knok: Pushing Notifications Now Becomes Simple!
What is it?
knok_knok is an easy-to-use python package for sending push notifications across andriod and ios devices.
Tired of looking around for solutions to send your notifications?
No more worries now, knok_knok does all the heavy lifting of research and bug-fixes for you. Let's get started.
Our Features include
- sending push notifications for the fcm tokens provided. Be it a token for an android device or an ios device, it doesn't matter.
- sending notifications to any number of devices at a time
- multiple notifications on a single device getting collapsed on the notification bar.
- sending notifications that redirects the user somewhere
- GCM has been deprecated so if you are someone who is migrating from GCM to FCM, you can also give us a try.
Getting Started
The source code is currently hosted on GitHub at: https://github.com/ajaysharma132/knok-knok
Binary installers for the latest released version are available at the Python Package Index (PyPI).
# PyPI
pip install knok-knok
for sending a push notification, all you need to do is -
- build a data_map containing the information for your notification message
- provide a list of fcm tokens for the devices you want to trigger a push notification
# data_map
{
"title": "Hello",
"body": "World !",
"url": "https://www.google.com/"
}
title - represents the title of the your notification
body - represents the body/text/message of your notification
url - is for the link you want the user to redirect to..
# tokens
[
'token1',
'token2',
'token3',
]
And so on... You can provide any number of tokens
Now, instantiate the FCMClient providing your FCM_API_KEY as -
# FCMClient instance
from knok_knok import FCMClient
client = FCMClient(FCM_API_KEY)
And use the send function to send your notifications as -
# send notification
client.send(data_map, tokens)
you see, it's that simple!!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file knok_knok-0.0.1.tar.gz.
File metadata
- Download URL: knok_knok-0.0.1.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8940445e235761be7f7b0ca56b53066d56cfbe15bfdf3867468078706938d32e
|
|
| MD5 |
f253ce0eb13d45a00ceb986a619fd346
|
|
| BLAKE2b-256 |
efa1cdca8cee9e840fb42e45e8a741fc2241c2ced06d7c80c8f1dcc4a616109b
|
File details
Details for the file knok_knok-0.0.1-py3-none-any.whl.
File metadata
- Download URL: knok_knok-0.0.1-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6bd0543fb5b0c279b236ba3e52efb8f1027db6fe5edbceee042392bd9ae0eb9d
|
|
| MD5 |
ba34cb261f39362dc8b20a34fead0003
|
|
| BLAKE2b-256 |
dc2666e758ec5241ce1b50f700435dec1518f6c9e075f11d39d44b1bab58129a
|