How to block / delete SMS messages?

chaoscreater

Active member
Hi,

I'm looking for a way to block and/or delete text messages. I've done some research on this, but I can't seem to find any decent solutions.

These text messages are work related. At my work, I sometimes have to be oncall for a week. When I'm oncall for that week, I need to look at text messages and calls that come through to my phone. These text messages are issues that I need to resolve. However, I don't need to look at them when I'm not oncall.

I already have a working macro to determine if I'm oncall or not. I also have a working macro that can block incoming work-related calls, based on whether I'm oncall or not. The only last bit I need to sort out is blocking the text messages.

My idea is to set phone to enable Silent Mode (with vibration off) when a work-related SMS is received, clear the SMS notification and then disable Silent Mode. But is there an actual way to block or even delete the message completely? My phone is rooted btw, so I don't mind if the solution requires root.

Also, I'm aware there are apps that can mute or block SMS messages, but those require you to manually mute or block them. The point of using MacroDroid is that I can automate this process, based on whether I'm oncall or not.
 
Last edited:

RSF

Well-known member
One possibility -- essentially have MacroDroid trigger the sound and vibration for SMS messages, vs. letting Android do it:
  • Configure your SMS application's notification sounds to "Silent" in Android's Settings > Apps > Notifications (don't disable the notifications, just set them to Silent, meaning they won't make a noise or vibrate or blink your LED if you have one, but will still display a notification)
  • Create MacroDroid macro to respond to all notifications for your Messaging app (in theory you could also trigger based on SMS message received, but if your messaging app is using RCS-type messaging, for example with Google Messages with chat mode enabled, MacroDroid can't trigger based on incoming SMS, but will still trigger using the notification approach)
  • In that macro, save the Notification title (which will generally be notification sender) and text (contents) into local variables, for example notif_title and notif_text. That'll let you use them in IF conditions (and inspect their values during testing)
  • Add IF action to dismiss the notification if not on call and the notification is from the company -- else play a sound and vibratl
Something like so:
Screenshot_20220628-211451.png
 

chaoscreater

Active member
Thanks. I'm already doing something like that, but my question was about actually blocking or deleting the SMS messages (just standard SMS).
 

RSF

Well-known member
Ah. I don't know of any straightforward way to set Android to turn on/off SMS for a given sender. Others may know.

Couple possible workarounds:
  • Use UI Interaction actions to add the work sender to your SMS app's "Blocked senders" list, and remove right before being on-call again. (though UI Interaction schemes are best avoided wherever possible, I think (too fragile))
  • Your carrier may have a way to send a short code SMS to specify a number to block/unblock (my carrier does not, though)
 

MacroDroidDev

Administrator
Staff member
In the early days of MacroDroid there was an action to delete SMS messages. Unfortunately in Android 4.something they prevented apps doing this and now only the default SMS app can modify the inbox.

I don't know any other way of doing this either unless your default SMS app provides some kind of interface because no other apps should be able to do it unless they are the default SMS app.
 
Top