I know. But they had to resort to a not-so-pretty foreground service to get around battery optimisations. Do you call that a good user experience?
In any case, this is the choice of a specific implementation, and not something inherent to XMPP. Your original comment said that integration with Firebase was needed, and I wanted to point out that it is already integrated.
More on the app-killing ROMs can be found at https://dontkillmyapp.com