iPhone
Remove unread messages
I have an old iPhone and I sometimes save old messages so I'll read them later. But then sometimes I forget and now they are very old and they just show a notification and I can't find it. It is very annoying. So there are a few options:
- On new iPhones, you can just filter. Mine is old.
- Ask Siri to read you your unread messages. It will show who your messages are from and then you can manually go into messages and search for them and reply to their messages.
- If they are truly unread and not just marked as unread, your MacOS messages will probably show them. You can right click on the menubar icon for messages and it will show you the unread messages.
- If there are still more, check your settings for messages and uncheck your "Filter Unknown Senders". This will make spam not be present, but will also leave you with a ton of unreads.
Searching messages[2]
The iMessage search is bullshit. Turns out they save everything as a SQLite database, so you can query it. You should copy the file before querying it to make sure you don't corrupt it.
# Copy the database to protect the data and bypass access/security issues
cp ~/Library/Messages/chat.db ~/Desktop/chat.db
# Test that it works
sqlite3 ~/Desktop/messages.db ".tables"
Use a DB viewer like TablePlus to make this experience a lot nicer.
Search for message by content
SELECT
datetime (message.date / 1000000000 + strftime ("%s", "2001-01-01"), "unixepoch", "localtime") AS message_date,
message.text,
message.is_from_me,
chat.chat_identifier
FROM
chat
JOIN chat_message_join ON chat. "ROWID" = chat_message_join.chat_id
JOIN message ON chat_message_join.message_id = message. "ROWID"
WHERE
-- Put your query here; surround it with wildcard `%`for good search
message.text like '%river%'
ORDER BY
message_date ASC;
References
- https://www.reddit.com/r/ios/comments/17r73df/why_does_imessage_show_72_unread_messages_when_i/
- https://spin.atomicobject.com/search-imessage-sql/
Last modified: 202610110325