I’ve been pointed towards “foreground service” on Android. Not sure, if there is iOS alternative.
Asked but not answered here: