Sending Push Notifications on iOS

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
seanmcnally
Posts: 3
Joined: 21 Mar 2022, 12:43

Sending Push Notifications on iOS

21 Mar 2022, 12:46

Trying to get my Autohotkey script to send a notification to my iPhone. I found some code to do this using Pushover, but the post is from 2017, and doesn't seem to work. Is there a newer method? Thanks.

Here's the post I found:
labrint wrote:
13 Nov 2017, 13:04
Step 1: Sign up with pushover
Step 2: Purchase the app (around 4-5 euro for lifetime of use)
Step 3: Create an AHK file with the following code
Step 4: Obtain your "user key" from https://pushover.net/
Step 5: Replace €€€ in code with the newly obtained user key from step 4
Step 6: Create your token by clicking "Create an Application/API Token" from https://pushover.net/
Step 7: Replace $$$ in code with the newly obtained token from step 6
Step 8: Try replacing the ££££ and #### to create new push messages (link them to some variable from your script)
Step 9: Try changing the sound in the param or adding parameters from https://pushover.net/api

Code: Select all


title := "££££"
message := "####"

param := "token=$$$&user=€€€=" message "&title=" title "&sound=cashregister"
str =https://api.pushover.net/1/messages.json

url_tovar(URL, param) { 
    WebRequest := ComObjCreate("WinHttp.WinHttpRequest.5.1")
    WebRequest.Open("POST", URL)
	WebRequest.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
    WebRequest.Send(param)
}

url_tovar(str, param)

User avatar
boiler
Posts: 17328
Joined: 21 Dec 2014, 02:44

Re: Sending Push Notifications on iOSd

21 Mar 2022, 12:55

It may be that the API has changed so the script is out of date, but it might also be that you didn’t follow all the steps prior to running the script correctly. Did you follow those steps including modifying the script accordingly?

Did you follow the direction of the subsequent post that corrected the script you quoted?
User avatar
labrint
Posts: 383
Joined: 14 Jun 2017, 05:06
Location: Malta

Re: Sending Push Notifications on iOS

22 Mar 2022, 02:17

seanmcnally wrote:
21 Mar 2022, 12:46
Trying to get my Autohotkey script to send a notification to my iPhone. I found some code to do this using Pushover, but the post is from 2017, and doesn't seem to work. Is there a newer method? Thanks.

Here's the post I found:
labrint wrote:
13 Nov 2017, 13:04
Step 1: Sign up with pushover
Step 2: Purchase the app (around 4-5 euro for lifetime of use)
Step 3: Create an AHK file with the following code
Step 4: Obtain your "user key" from https://pushover.net/
Step 5: Replace €€€ in code with the newly obtained user key from step 4
Step 6: Create your token by clicking "Create an Application/API Token" from https://pushover.net/
Step 7: Replace $$$ in code with the newly obtained token from step 6
Step 8: Try replacing the ££££ and #### to create new push messages (link them to some variable from your script)
Step 9: Try changing the sound in the param or adding parameters from https://pushover.net/api

Code: Select all


title := "££££"
message := "####"

param := "token=$$$&user=€€€=" message "&title=" title "&sound=cashregister"
str =https://api.pushover.net/1/messages.json

url_tovar(URL, param) { 
    WebRequest := ComObjCreate("WinHttp.WinHttpRequest.5.1")
    WebRequest.Open("POST", URL)
	WebRequest.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
    WebRequest.Send(param)
}

url_tovar(str, param)

I remember back in the day I used this to push each sale from my ePOS to my phone so I would know the live Z-Reading. Then I switched over to Ragic and pushed data into neat tables for easier viewing. Maybe Ragic interests you.
dbgba
Posts: 20
Joined: 02 Apr 2021, 22:11

Re: Sending Push Notifications on iOS

29 Mar 2022, 08:12

Try Bark, the solution to your needs

https://github.com/Finb/Bark
User avatar
boiler
Posts: 17328
Joined: 21 Dec 2014, 02:44

Re: Sending Push Notifications on iOS

29 Mar 2022, 08:29

I have since gotten Pushover to work, and it works very nicely. Note as I mentioned before that the quoted code has an error in it as was corrected in a subsequent post from that thread.
seanmcnally
Posts: 3
Joined: 21 Mar 2022, 12:43

Re: Sending Push Notifications on iOS

02 Nov 2023, 17:36

Older thread, but I've since found a better solution using the app Telegram.

Step 1) Inside telegram, go to https://t.me/BotFather and create a bot. Note the API key.

Step 2) Then go to https://t.me/RawDataBot and use it to find your personal Chat ID, so you can address messages to yourself. It'll look something like this:

Code: Select all

        "chat": {
            "id": XXXXXXXXX,
Step 3) You can now send messages to yourself via telegram using this command in Command Prompt

Code: Select all

curl -s "https://api.telegram.org/bot$API_KEY/sendMessage?chat_id=$CHAT_ID&text=hello%20world"
Replace $API_KEY and $CHAT_ID (deleting the $) with your actual api key and chat id.
Note that you'll need to do %20 for any spaces in your message.

Step 4) Now you'll just need to implement it into your AHK script. This will send a message when you hit the NumPadDiv key.

Code: Select all

NumPadDiv::
Run cmd.exe /c curl -s "https://api.telegram.org/bot$API_KEY/sendMessage?chat_id=$CHAT_ID&text=hello%20world",,hide
return

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], CoffeeChaton, Google [Bot], peter_ahk and 124 guests