Run the App in background

We have made a app where we monitor the weather conditions using IoT. When any parameter crosses a certain value, a notification is raised. We are using Notification Extension by Juan Antonio .
We want to run the application in background and receive notification even if the app is not opened. We are unable to do so. Please help.

Can you try using BackgroundTasks extension by @Kumaraswamy ??

Can you give any example (application) of this extension ?