Skip to content

su-bitcoding/firebase_web_notifications_sent

Repository files navigation

firebase_web_notifications_sent

Setup

Clone the repository:

$ git clone git@github.com/su-bitcoding/firebase_web_notifications_sent.git
$ cd firebase_web_notifications_sent

Create a virtual environment to install dependencies and activate it:

$ python3 -m venv env
$ source env/bin/activate

Install the dependencies:

$ pip install -r requirements.txt

Migrations:

$ python manage.py migrate

Run the server:

 $ python manage.py runserver

And navigate to http://127.0.0.1:8000/.

Generate a firebaseConfig

your firebase a project when you sent a notifications in project settings in you create a web app that you can get a config file

Generate KEY_FILE_PATH

your firebase a project in a settings in service account in generate a key file
 

Generate vapidKey

your firebase a project in a settings in cloud messaging in generate a keypair is your vapidKey 

Sent notifications cURL

curl --location 'http://127.0.0.1:8000/sent-web-notification' \
--header 'Cookie: csrftoken=IrIwJfkiZR7W5l6rauazusaybAesDtFP' \
--form 'token="your generate a frontend side token "'  \
--form 'title="hello Testing"' \  
--form 'body="testing"'