To keep your app secure, it is essential that you build it with an end-to-end encryption feature. This ensures that the messages your users send or receive is completely ciphered and cannot be intruded by anyone other than the sender and receiver, in fact, even by you.
Also, you need to make sure that your chat apps are built to adhere to global security and privacy standards like GDPR, HIPAA, ISO and OWASP.