How do I prevent my iPhone from getting alerts when using Messages on my Mac? I like to use Messages on my Mac, but it's generally incredibly annoying because every time I receive a message from someone, my iPhone lights up and plays its alert noise, which is a loud ding. I want it to do that in general, but not when I'm actively using Messages on my mac. Is there anyway to fix this situation?  I have considered turning on "Do not disturb" on my phone, but I don't want to because I'm liable to forget I did and then miss important messages.
Short of enabling Do Not Disturb on iPhone, or disabling notifications for the Messages app on iPhone (even more tedious than remembering to turn Do Not Disturb off), there is no direct way to prevent both iPhone and Mac from alerting you to the same message.

That said, I have noticed that if I am actively using Messages on Mac, after a few minutes I will start getting the messages on Mac first, and if I go to the Messages window quickly enough I will not get the alert on iPhone. Once I stop actively using Messages on Mac, the alerts on iPhone start appearing in a timely manner again. It seems to recognize which system or device you are actively using and delays notifications to the other systems/devices by a bit. The same occurs when I am using iPad - notifications on Mac and iPhone are delayed enough that if I read the message on iPad quickly enough, I will not get the notifications on the other devices.

I am not sure if the above is actually an unadvertised feature or just network delay, but it occurs consistently enough that I am quite sure there is some Apple intervention going on there.