In my app I need a background-fetch task that queries a server and notifies the user with a local notification if there's any new data.
I can't seem to get the app to push the notifications when it's in the background, even if I simulate background fetch with xcode. The most I've managed is to simulate background fetch with a xcode terminal command (e -l objc -- (void)[[BGTaskScheduler sharedScheduler] _simulateLaunchForTaskWithIdentifier:@"TASK_IDENTIFIER"]) while the app was in the foreground, but I can't get it to work when the app is running in the background.
I have enabled background fetch in capabilites and device settings, I have the task identifier defined in Info.plist and I followed this tutorial to implement background fetch: https://www.andyibanez.com/posts/modern-background-tasks-ios13/
I've been stuck on this for a while now. I'd really appreciate any help.