Issues with https auth challenge and background asset download extension

I'm trying to get a background asset extension working with iOS 16.1/Xcode 14.1.

I'm able to succesfully download a file when using BADownloadManger from within the app, but not if the extension tries to download the same file.

I've discovered its not possible to use a url with http for the asset download as the OS performs a check and throws an exception saying only https is accepted.

However when you use a https url there's an authentication challenge. I implemented the auth challenge method of BADownloadManagerProtocol within the app (it completes with AuthChallengeDisposition.performDefaultHandling) and the file is sucessfully able to be downloaded when the download is initiated from within the app.

However, the same file cannot be downloaded when its downloaded from the extension. I implemented the BADownloaderExtension: didReceive challenge method within the extension (which returns the same thing, AuthChallengeDisposition.performDefaultHandling) however when the extension is attempted to be invokved (using the backgroundassets-debug command line tool) then the handset logs this:

Failed to send -[BADownloaderExtensionProxy sendAuthenticationChallenge:download:completionHandler:]_block_invoke

and the download fails.

Why does the download succeed from the app but not from the extension? Why is the OS saying it can't send the auth challenge when I'm implemented the relevant method of BADownloaderExtension?

Please install iOS 16.1 (Beta 4) 20B5064c along with Xcode 14.1 beta 3 (14B5033e) and let us know if you continue to experience this issue. After updating you may need to recreate the extension from the template.

-- If this issue continues to occur, we'd be more than happy to take a closer look by examining a sysdiagnose from your device.

Instructions for gathering a sysdiagnose can be found at the link below. Search for the "sysdiagnose" section and follow the instructions. iOS Profile and Logs

Then file a bug report to: https://bugreport.apple.com

Issues with https auth challenge and background asset download extension
 
 
Q