Open In App

Send Chrome Notification Using Python

Last Updated : 17 May, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

In this article, we are going to see how to send a Chrome notification from your PC to a phone or several devices in this article. We may send messages, links, and other content. For this, we’ll use Python’s notify2 module and its various capabilities, which will help us in delivering messages to many devices.

notify2 is a Python module that is used to deliver notifications and may be used for a variety of applications. For example, if we are creating a news notifier and you want to view the changes on your smartphone rather than your local workstation, we can easily use this module.

Installation:

pip install notify2

Stepwise Implementation:

Step 1: Create a program that takes you to subscribe to the webapps.

Python3




from notify_run import Notify
  
notify = Notify()
notify.register()


Output:

You will be given a link and a QR code; click on the link or scan the QR code to proceed.

Step 2: When you click on the link, you will be presented with the following interface:

Step 3: Simply click on the subscribe on this device button, and if you want alerts on other devices, the link is provided at the bottom; simply go to your device’s chrome, copy this URL, and then click on the subscribe on this device button.

Step 4: Now write a Python program to send the notification.

For sending alerts, the send function is utilized. Simply write a message within the send function and execute the script; you will be alerted by Chrome as well as any devices to which you have subscribed.

Python3




from notify_run import Notify
  
notify = Notify()
notify.send("Any Message you want to send")


Output: 

You will notify by Chrome after you run the script

After you run the script, the message will also be shown on the web:

Other devices, like the phone:


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads