The only way to make sure notifications are shown is to use a server and the relevant platform’s push notifications.
You’ll have a hard time keeping a process running, active, and connected in the background. Even if it’s possible on Android (not quite sure) it definitely won’t be possible on iOS.
So your app needs to register for notifications and send the relevant token to the server.
Your server (possibly the same one running the MQTT broker) will then need to send notifications to your phone using that token whenever needed. How that process is triggered is up to you. You could have a client running on the server receiving the MQTT messages and triggering the notifications, or it could be some sort of integration directly in the broker.