Firebase Cloud Messaging API with Python

Ravi Shankar Singh
DevMins
Published in
2 min readMar 28, 2020

Firebase provides an easy way to send notifications to your Android or iOS devices using device token or by subscribing to topics.

Sending notification from python using Firebase API is quite easy if you follow these steps:

  1. Get your server key (You can get your server key in your Firebase console)
  2. Device Token
  3. Python set up on your local machine
  4. Install the “requests” module

Install the “requests” module by running

pip3 install requests

fcm_python.py

Replace the device token key with the device Token for which you want to send push notification. Replace server token key with your server key from Firebase Console.

Run script by ->

python3 fcm_python.py

GitHub Repo:

Did I get something wrong? Mention it in the comments. I would love to improve.

If you liked what you read, please leave some claps!

Follow me:

Twitter: https://twitter.com/imRaviSSingh

Facebook: https://www.facebook.com/itsravishankarsingh

Instagram: https://www.instagram.com/itsravishankarsingh/

Github: https://github.com/ravishankarsingh1996

LinkedIn: https://www.linkedin.com/in/itsravishankarsingh/

About.me:https://about.me/itsravishankarsingh

--

--