mobile – How do big messaging apps keep users connected

So let’s take the Facebook Messenger app for example. When you send a message it instantly gets sent to the other user you are writing to.I believe they use some kind of WebSockets to send these messages (correct me if I’m wrong).
But when the other user closes the app, does he still receive the message? Does Messenger always keep Websocket connections alive? Because if they don’t, how comes the other user still receives a notification saying he got a new message?

I don’t understand a lot about this technology so I might be really far away from reality.