` func submitBackgroundTasks() {
// Declared at the "Permitted background task scheduler identifiers" in info.plist
let backgroundAppRefreshTaskSchedulerIdentifier = "com.FeedX.backgroundAlerts"
let timeDelay = 10.0
do {
let backgroundAppRefreshTaskRequest = BGAppRefreshTaskRequest(identifier: backgroundAppRefreshTaskSchedulerIdentifier)
backgroundAppRefreshTaskRequest.earliestBeginDate = Date(timeIntervalSinceNow: timeDelay)
try BGTaskScheduler.shared.submit(backgroundAppRefreshTaskRequest)
print("Submitted task request")
} catch {
print("Failed to submit BGTask")
}
}
I am able to submit the task and hit the breakpoint but in the LLDB i try to simulate the task using the command
e -l objc -- (void)[[BGTaskScheduler sharedScheduler] _simulateExpirationForTaskWithIdentifier:@"com.FeedX.backgroundAlerts"]
But i get the following error :
error: Error [IRForTarget]: Rewriting an Objective-C constant string requires CFStringCreateWithBytes
Any idea on how to solve this or run the task using a different way? Thanks.