Better Programming

Advice for programmers.

Follow publication

How to Send Push Notifications to Your Phone From Any Script

Getting notified when tasks complete

Jamie Bullock
Better Programming
Published in
4 min readJun 19, 2020

--

Photo by Jamie Street on Unsplash

As programmers, we often need to set off long-running tasks and scripts. This may include:

  • Transferring or copying large files
  • Processing big data sets
  • Lengthy compiler processes

With any kind of time-consuming script, it’s convenient if not essential to know when the script finishes. We also want to know whether the process succeeded or failed.

While some software includes these kinds of notifications built-in, most command-line tools don’t. Also, we ideally want to obtain notifications wherever we are, not only on the device where the script is running.

Using IFTTT

Image courtesy of the author

Sending push notifications to any mobile device can easily be achieved with the web service IFTTT. This can be used to hook up a web request sent to a given URL to a companion app installed on a mobile device.

Here are the steps to achieve that:

  1. Visit http://ifttt.com and sign up for an account.
  2. Click on your account icon (top right), and then click on Create.
  3. Click on the If+ icon and type “Webhooks” in the search box.
  4. Select Webhooks → Receive a Web Request and type “notify” for your event name.
  5. Next, click on the +That icon and type “Notifications” in the search box.
  6. Select “Send a notification from the IFTTT app.”
  7. Type the following text into the Message box:
Notification: {{Value1}}

8. Click ‘Create action’ and then give your action a name, e.g. “Push Notification.” Then click on Finish.

Congratulations! You’ve now created an IFTTT action.

Testing the Notification

To test the notification, you need to download the IFTTT app on your mobile device and sign in with your account. It should prompt whether…

--

--

Responses (4)

Write a response