Summary
- Googling spam calls takes too long to complete before the caller hangs up.
- A shortcut can help, but you can’t trigger shortcuts when your iPhone rings.
- I resorted to using the back tap gesture to trigger my shortcut to check the incoming number usng ChatGPT.
While silly Monty Python songs about processed meat may be fun, unwanted marketing calls and emails are not. I’m sick of getting calls from unrecognized numbers, only for them to turn out to be telling me that I’ve been in an accident that wasn’t my fault. I thought there may be a way the Shortcuts app could help.
Googling Spam Calls Takes Too Long
It’s incredibly frustrating when a phone call comes through from a number that’s not in my contacts. It’s highly likely that it’s a spam call, but it may also be an important call from someone like my doctor or my energy supplier that I don’t want to miss.
You can guarantee that if I do answer it, it will be spam, and if I don’t, it will have been something really important.
So when a number comes up that I don’t recognize, I quickly Google it to see if it’s been reported as a nuisance caller. The problem is, by the time I’ve searched for the number and read through the results, the call has already rung off.
I Decided to Create a Shortcut to Do the Job for Me
This happened to me again recently, and I started to wonder if there was a way that I could automate things so that my iPhone would check the number for me whenever a call from a number that wasn’t in my contacts came through.
I knew that I could create a shortcut on my iPhone that would perform a web search, for example. It seemed like it should be possible to make a shortcut that would check a number for me so I could quickly find out whether it was spam or a legitimate call.
You Can’t Trigger a Shortcut When Your Phone Rings
I soon hit a roadblock, however. In an ideal world, I’d be able to trigger my shortcut whenever I had an incoming call on my iPhone. That way, whenever my phone rang, the shortcut would run. I would then be able to extract the phone number, search for information about that number, and see if it was from a number with a history of making spam calls.
The trouble is, although you can trigger automations on your iPhone in a wide variety of different ways, it’s not currently possible to trigger a shortcut when your iPhone rings. This is a shame, as it would definitely be a useful trigger to have; you could create any number of useful automations off the back of it. I had to think of another way.
I Resorted to Using the Back Tap Gesture
If it wasn’t going to be possible to trigger my shortcut when my iPhone started ringing, my only option was to launch the shortcut manually. I could use the Action button on my iPhone 15 Pro, but I already use this for other purposes, and there weren’t any shortcuts actions I could use to change what the Action button does when the phone is ringing.
Instead, I decided to trigger the shortcut from the back tap gesture. This is an accessibility gesture that you can use to perform actions on your iPhone, such as opening the camera or control center by tapping the back of your iPhone two or three times. One of the options for the back tap gestures is to run a shortcut, so once I’d created my shortcut, I’d be able to run it whenever my phone was ringing by tapping the back of my iPhone three times.
Planning a Shortcut to Check the Incoming Number
The final step was to create a shortcut that would check the incoming number when a call was coming in. I could use a web search, but this would still require me to look through the results to see if the number was spam or not. I figured the quickest and easiest way to do it would be to ask ChatGPT.
I would need to pass ChatGPT the number for the incoming call. Since this appears on the screen when the call comes in (unless the number has been withheld) I could get the shortcut to take a screenshot. I could then use the “Extract Text From Image” action in the Shortcuts app, which uses optical character recognition (OCR) to extract text from an image.
Once I’d extracted the text, which would include the phone number, I could pass it to ChatGPT and ask it to search for the number online and tell me if it was likely to be spam.
Creating My Shortcut
Now that I knew all of the steps that I needed in my shortcut, it was time to start building it. The shortcut only requires three actions to work.
Open the Shortcuts app and tap the “+” icon in the top right corner to create a new shortcut. Tap “Search Actions,” type “screenshot” and select “Take Screenshot.” Search for “extract” and select “Extract Text From Image.” This will extract the text from the screenshot, including the incoming number.
Search for “ChatGPT” and select “Ask ChatGPT” from the results. You can choose which model to use; I opted for GPT-4o. Tap “Message” and enter something like the following: “Search for the phone number from this text and tell me if it’s safe or spam. Make the first word of the response either “SCAM” or “SAFE” and keep the response brief.”
Tap “Text from Image” from above the keyboard, which will add the text extracted from the screenshot to your message. Tap the arrow and toggle “Continuous Chat” off so that ChatGPT only gives you a single response.
Tap the name of the shortcut at the top of the screen and select “Rename.” Give your shortcut a memorable name and tap “Done” to save it.
Assigning the Shortcut to the Back Tap Gesture
Once you’ve created your shortcut, the final step is to assign it to the back tap gesture. You need to do this through the Accessibility settings.
Go to Settings > Accessibility. Under “Physical and Motor,” select “Touch.” Scroll to the bottom of the screen and select “Back Tap.” Select “Double Tap” or “Triple Tap.” Scroll down and select the shortcut that you created. Your shortcut is now set to the back tap gesture.
Using My Shortcut When I Get a Call
Now that I have my shortcut set up to run whenever I use the back tap gesture, I have a much better chance of seeing if a call is spam before they hang up. When a call comes in and I don’t recognize the number, I triple-tap the back of my iPhone and the shortcut runs. In a moment or two, ChatGPT tells me whether the call is spam or safe, and I know whether to answer it or not.
The Shortcut Isn’t Perfect but It Helps
This method isn’t ideal and has some major flaws. The biggest issue is the caller withholds their number. There’s no number to check, so the shortcut becomes useless. Frustratingly, some legitimate calls withhold their number so you’re back to square one.
The other issue is that the method isn’t instant. When a call comes in you have to pick up your phone, perform the back tap gesture, and then wait for ChatGPT to check the number. If you’re not fast enough, the caller may hang up before the process is complete.
However, in many cases, it’s good enough to work, enabling me to answer legitimate calls before they hang up.
Without the possibility to trigger a shortcut whenever my iPhone starts ringing, using the back tap gesture is the best I can do using the iPhone’s native tools. However, my next plan is to see what I can make using Home Assistant. For Android phones, there’s a “phone_state” sensor that will change when the phone is ringing, but this doesn’t exist for the iPhone, so it looks like another workaround will be needed.