Your perception of XMPP is over a decade out of date. XMPP has push notifications and end-to-end encryption in all the modern apps.
You're quite right that a situation such as you describe (requiring the app to be open to receive messages) would be a horrible experience. Support for push notifications was a solved problem years ago.
There is no way for your selfhosted xmpp server to deliver notifications to an iPhone unless you are the publisher of the xmpp client app you use (which requires doxing yourself to Apple and paying $99/year if you don’t want to sign new binaries every week).
The server support is irrelevant; this is an iOS/APNS issue.
You're quite right that a situation such as you describe (requiring the app to be open to receive messages) would be a horrible experience. Support for push notifications was a solved problem years ago.