The PushSend application sends secure (i.e. HTTPS) notification messages from RISC OS Wimp applications, usually to your mobile phone, via Pushover. The notification contains a string. The accompanying sound can be chosen.
The AcornSSL module is used to handle the secure communication.
Information required for the application is stored as environment variables, set up in the !Run file, so can be altered to suit once you have created your Pushover application (an easy process).
When the app is run, it optionally sends a message to Pushover notifying startup, and it sits on the icon bar waiting for a Wimp message, whereupon it sends a web message to Pushover.
You need to download a Pushover app for your mobile phone (Android or iOS) or browser (Chrome, Firefox or Safari). The Android app is available from the Google Play Store; the iOS app is available from the App Store. The browser app is available from the Pushover website, https://pushover.net
When the Pushover app receives a notification, by default it plays a sound. Optionally you can make it play a different sound, or vibrate only, or no alert, by sending a message with a sound number. See below.
The PushSend app is released under the GNU General Pulic Licence (GPL) version 2, but NotifyLib is released as freeware in order to avoid any legal difficulty caused by linking to it.
You must create your own Pushover application. For this you have to sign up to Pushover. You get a free period of 7 days, after which, if you wish to continue to use the service, you need to pay. Currently this is a one-time payment of a few pounds. Creating the app is very easy; instructions are on the Pushover web site and there is no point in repeating them here. You need to copy the User Key and the App Token, both of which are long random-looking strings, because they are needed by PushSend (this RISC OS application) to communicate specifically with your Pushover application and thereby send the notifications to your device. See below.
Pushover asks for a PNG app icon. They don't make it very clear that this is optional. I've provided a PNG of a RISC OS cog along with this app in case you want to remind yourself that the notification has come from a RISC OS system.
These are set in PushSend's !Run file.
PushSend$ServerName is the address to send the web request to - this is api.pushover.net and you should not alter it.
PushSend$HostName is the host you're sending to - this is /1/messages.json and you shouldnot alter it.
PushSend$ServerPort is the port number: 443, for HTTPS. You should not alter it.
PushSend$UserKey is the very long User Key that Pushover generates for you when you register your application.
PushSend$AppToken is the very long App Token that Pushover generates for you when you register your application.
PushSend$StartupMessage allows you to choose whether PushSend sends a Pushover message on startup and closedown. A non-blank value causes the message to be sent. Commenting the line out is the simplest way to NOT send a message. The message content cannot be altered; it is "PushSend version {version} starting up on {hostname} at {time}" (substitute "closedown" for "startup" for the closedown message).
PushSend$StartupSound allows you to choose which sound accompanies the startup and closedown messages, if you choose to send them. If you don't set the variable, or if you try to set the value outside the range 0 to 22, PushSend uses the default sound. If the startup and closedown messages are NOT to be sent, the presence or value of PushSend$StartupSound is ignored.
To make it easy to send these notifications from BASIC, use NotifyLib. There are minimal test applications called Test01 and Test02, which should make clear what to do. There are four steps:
1) LIBRARY <PushSend$Dir>.NotifyLib
2) PROCpushsend_init_includes
3) Ensure that the PushSend app is running (should be visible on the icon bar).
4) To send a message, either:
•PROCpushsend_send_message("This is my message")
or:
•PROCpushsend_send_message_with_sound("This is my message", number)
where "number" is the number of the sound to play. See below. If the sound number is outside the range 0 to 22, the default sound is used.
Note that PROCpushsend_send_message and PROCpushsend_send_message_with_sound send a Wimp message, which can only be done from within a Wimp application.
A non-default sound is specified by a number between 0 and 22. The sounds are all defined by the Pushover app; you can't send one of your own. The numbers and corresponding sounds are:
Number | Descriptive name |
---|---|
0 | Pushover (this is the default sound) |
1 | Bicycle bell |
2 | Bugle |
3 | Cash register |
4 | Classical |
5 | Cosmic |
6 | Falling |
7 | Gamelan |
8 | Incoming |
9 | Intermission |
10 | Magic |
11 | Mechanical |
12 | Piano bar |
13 | Siren |
14 | Space alarm |
15 | Tugboat |
16 | Alien |
17 | Climb |
18 | Persistent |
19 | Echo |
20 | Up and down |
21 | Vibrate only |
22 | None |
To use the default sound: Send a Wimp UserMessage (i.e. 17), with message action &89DC40 in block + 16, and your control-terminated message string in block + 20 onwards, and the length of the block in block + 0 (24 to 256, including the terminating character, a whole number of words). This limits the length of the message to 235 characters maximum plus the terminator.
To use a non-default sound: Send a Wimp UserMessage (i.e. 17), with message action &89DC41 in block + 16, your sound number (1 byte only) in block + 20 and your control-terminated message string in block + 21 onwards, and the length of the block in block + 0 (24 to 256, including the terminating character, a whole number of words). This limits the length of the message to 234 characters maximum plus the terminator. If the sound number is outside the range 0 to 22, the default sound is used.
You can download PushSend here.
0.07 2019 December 27 First issue
0.11 2020 November 14 Rewritten to use URL_Fetcher and AcornHTTP. Sounds added. Startup message made optional. Website button added. Licences added
0.12 2020 November 16 Added optional closedown message. Startup and closedown messages include time
Page last updated 2020 November 16