About a decade ago, Apple actually provided the metadata of the iMessage conversation to the FBI!
You could always use iMessage on a secondary device like an iPad.
This is pretty common.
Every time you type a number into your iPhone for a text conversation, the Messages app contacts Apple servers…Apple records each query in which your phone calls home to see who’s in the iMessage system and who’s not.
Apple is is compelled to turn over such information via court orders known as “pen registers” or “trap and trace devices”