My standard response is: don't do that, it will waste the device battery. Why do you need to send a message on a regular basis? If you need to do something like simulate the passage of real-world time in a game, then you can just measure the time between the app suspending and resuming, and simulate that much time passing, allowing the device to save battery in between.
I need to do an in-game chat.
To do this, I took an example of a multiplayer chat.
But if you are absent from the chat for 10 minutes, the chat closes. And if the chat is minimized, then messages do not come to it.
How do I solve this problem?
P.S. There is a bug in the chat itself.
If you turn off the Internet and then turn it on, you will need to restart the app to enter the chat. Because the app thinks that I am IN the room, but NOT connected to the server and NOT logged in.
Some kind of paradox :)
read more about this bug here: construct.net/en/forum/construct-3/how-do-i-8/leave-room-mutliplayer-chat-164494