Unless your app is a social app, and even then I'd integrate messaging only if it's a core ability.
At work, the team that was responsible for the app before I came along, 12 years ago, wanted to integrate a messaging ability into our internal company app.
I was literally shocked when they told me that, since that it reflected such a disconnect from reality, reality being the app was extremely crashy, not documented, and filled with bugs, and a disconnect from what users really wanted (I'm a former user turned core dev) that I couldn't even believe these people were for real.
But the app is partly a social commenting app, with reddit style comments. And for some other features, there are some one-on-one communications that need to happen. For now, those conversations happen out of band ( discord, ... ). Users that are out of the loop just miss out and even users that are in the discord room keep asking for in-app messages regularly. That's why now, it's on the todo list.
Post COVID, 99.99% of the company is using Teams for quick sync chats, WhatsApp for company broadcasts, and email for longer term async chats. We're probably going to deprecate the feed mechanism.
My takeaway is unless your solution is so compelling that it will draw people away from these existing platforms and the network effect that draws them into them, its not worth the effort.
For outbound messaging, emails are sent from the sever.
It would be awesome if other applications, like Teams, Slack, and Discord had a mailto:-like integration, but they don’t.
In fact, this was the original use case for Firebase, which was first released as a tool for building in-app chats.
The disadvantage is that you have to build it. It's easy, so I'd say that's really an advantage because you will deeply understand it. NoSQL data and websockets are really important technologies and Firebase is free, including hosting, until you hit some pretty high usage limits.
Literally just a "GET getChatMessage(AUTH, USER)" and a "POST sendChatMessage(AUTH, USER)". And inside getChatMessage, delete all messages that are sent.
But it only make sense if their pricing fit your business model.
Usually such services are priced by number of users and/or concurrent connections. So they only make sense when you're small and very fast can become prohibitively expensive. Then it's a time to implement your own messaging functionality.
Users have come to expect a chat experience that Just Works, and has all the basics covered. Those basics, however, go a lot longer than just the websocket/firebase "hello world" chat app and it's a lot of work to cover them sufficiently well. Typing indicators, online status, sharing photos and files and locations, reliable delivery on shitty networks, notifications through other channels (eg push, email, etc) when not logged into your site/app, URL previews, read receipts, replies, edit/delete, emoji rendering, emoji reactions, and on and on and on. And with good design and UX for all of them.
Must you have all of these? Definitely not. But if a user feels they need some of them to have a comfortable/effective chat, they'll go to great lengths to move the conversation away from your app to some other channel (eg Telegram or WhatsApp). We have quite some customers who replaced a handrolled chat by TalkJS, citing users actively trying to circumvent their own messaging functionality as a primary reason.
Meta level note: Most users, especially the not-very-techy ones (ie the vast majority) really do appreciate having good communication tools right at their fingertips, directly in the application they're currently using. Nevertheless I agree with the current top comment in that if you business does not suffer from leaking users to other services and your users are relatively tech savvy, you probably get the happiest users fastest by just letting people share Telegram/Whatsapp/Matrix/Discord contact info and calling it a day. But otherwise, build a good chat feature. We're just one of the options, it's worth it and it's very little work.
Do reach out if you think we may be of service! Our chat support is manned by programmers so ask away :-) (or hit me an email, contact info in my hn profile)
Definitely not easy, and I'm not exactly sure if it's the best choice, but it's doable.