Stock alerts app

  1. Summary of my problem

Hi guys, I built an app to set some alerts on stocks prices. So I fetch the stock’s data from yahoo finance and then compare it to a target price every 30 seconds and send a notification when the actual price is below the target. As I was expecting, as soon as I kill the app, the function stop running. How could my function runs even if the app is close? Do I need to use some cloud function or something else ?