Something similar happened to me , but in order for your I phone to either get infected or hacked by text messaging? The text you received would have to have an URL or website that once you tap on that , would bring you to online platform then possibly a hacker/ infection could possibly breach your I phone. I would restart the phone for starters , then turn it off, login to your Apple ID from another device such as a PC or a friends Phone and change password associated to your apple account. Soft reset your phone , restart , then login to Apple ID with new password associated with your account. Why all these steps? Loop infections if any will be terminated. If it’s a Hacker ? Your login credentials are changed from a different device. This info works on alot of different troubleshooting variations. Also verify buttons and charging port for any debris , stuck power button can deplete a battery under 4 mins, phone would over heat and shutdown. Last but not least you can verify your battery info , which apps are using battery consumption. Indicated in % . If your Messaging app has The highest percentage in battery usage? That also would indicate possible breach of your phone through text message. After many years f taking several I phones apart , I’ve learned that apple products are good but not bullet proof. PS Two problems arise from one generation to another on I phones, battery and (sound/ mic) Very sensitive phones once exposed to different temperatures. Hot / Cold and inside and outside. Best regards P. Morin