Search code examples
swiftios13background-task

iOS Background Task in IOS 13 Not working


Im trying to work on with iOS 13 background tasks to be executed and created the sample application as per apple says: https://developer.apple.com/documentation/backgroundtasks/bgtaskscheduler

But some how im still getting error in console as:

Can't end BackgroundTask: no background task exists with identifier 1 (0x1), or it may have already been ended. Break in UIApplicationEndBackgroundTaskError() to debug.

And this seems like many are experiencing this issue: https://forums.developer.apple.com/thread/121990

Thanks


Solution

  • The BGTasks worked fine with the new iOS 13.4 and i tried this on real device and it seemed working fine. So the issue was it wasnt working on simulator but on device its fine.

    I never tried this on other device, rather i just tried on device with iOS 13.4. Seems to be fine.