Posts

Post not yet marked as solved
1 Replies
@GeertB is correct, you may set it to 0 for non-essential downloads to bypass this restriction. We'll update the header documentation, thanks for bring this to our attention.
Post not yet marked as solved
1 Replies
Background Assets is currently unavailable for native visionOS apps. There is compatibility support for iOS apps that use Background Assets running on visionOS, but not for native apps. Please file a a request for this using Feedback Assistant, it helps us gauge developer interest.
Post not yet marked as solved
2 Replies
If you're experiencing this issue on iOS 17's latest beta, please use Feedback Assistant with a sysdiagnose. We'd be more than happy to take a look. Is your extension running? If the extension is holding onto exclusive control and not letting go of it, I'd expect this to happen.
Post not yet marked as solved
1 Replies
BAEssentiaMaxInstallSize / BAMaxInstallSize should be the size that your files take up on the user's device. So if you're extracting files, you'll want to use the extracted size. The value you place in these keys will be shown to the user on the App Store. BAEssentialDownloadAllowance / BADownloadAllowance are restrictions against your extension that control how many bytes can be downloaded before the app has been launched. That's why these keys are in a dictionary named BAInitialDownloadRestrictions; since they're only initially enforced. These essential keys are completely separate from the non-essential keys. The essential keys should be for BAURLDownloads that have the isEssential property set to true.
Post not yet marked as solved
1 Replies
Any URLs you'd like to download from, must have their hostname specified in the BADownloadDomainAllowList or else Background Assets will not permit downloading those files until the app has been initially launched by the user. https://developer.apple.com/documentation/bundleresources/information_property_list/bainitialdownloadrestrictions/badownloaddomainallowlist
Post marked as solved
1 Replies
The manifest file is managed by the system, and your app/extension doesn't have write access to it. Your options are to parse the file in its current location, or copy it to a location you manage within your container.
Post not yet marked as solved
1 Replies
Looking at the limited logs presented here, I believe your extension is crashing or being terminated. I'd encourage you to see if there are any crash files.
Post not yet marked as solved
1 Replies
On these devices a dialog should appear when the app is initially installed, in order to grant access to the network. If the user taps Don't Allow, then background assets will not function.
Post not yet marked as solved
1 Replies
This is covered in the new WWDC23 session: "What's new in Background Assets". The essential argument was added in 16.4 and true can only be passed from within the extension during an app-install or app-update.
Post not yet marked as solved
2 Replies
If anyone else hits this, you may be able to resolve this error by changing com.apple.developer.team-identifier to $(DEVELOPMENT_TEAM). The issue is that $(TeamIdentifierPrefix) is not set in your Xcode project.
Post not yet marked as solved
2 Replies
You'll want to make sure that your extension's bundle identifier is prefixed with the app's bundle identifier. Example: App Bundle ID: com.myCompany.myApp Ext Bundle ID: com.myCompany.myApp.BackgroundDownloaderExtension The suffix can be named anything you want, as long as it is prefixed with the app's bundle identifier.
Post marked as solved
1 Replies
Here you go, added in iOS 16.4. https://developer.apple.com/documentation/backgroundassets/badownloadmanager/4143373-fetchcurrentdownloads If you need to support older releases, you'll want to use a DispatchSemaphore to make the async version synchronous. I'd highly discourage that approach though as the kernel will be unable to propagate your thread's QoS to the system daemon. The new synchronous API does not have this problem.
Post not yet marked as solved
2 Replies
In iOS 16 the extension is currently configured for 6MiBs memory usage. If the extension exceeds this threshold, the system will terminate it. I'd advise memory mapping the file with NSData using NSDataReadingMappedAlways. Memory mapped files that are backed by storage do not count towards overall memory usage of your process, as long as the file isn't modified after opening it. This will allow you to read the file from physical storage without paying a penalty of placing the file into physical memory.
Post marked as solved
1 Replies
The extension runs in a very tight sandbox to prevent use cases outside of its intended design. Therefore the extension is only permitted for scheduling/managing downloads with Background Assets.
Post not yet marked as solved
1 Replies
BackgroundAssets is perfect for this use-case. On macOS the extension is given runtime despite the app being terminated. On iOS we require that the app wasn't terminated by the user for the extension to be given runtime. You'd use the BAManifestURL to download a catalog/manifest that contains URLs to content you may want to download. You'd parse the manifest in the extension to know if there is anything to download. From there you'd return all the downloads you'd need in: func downloads(for contentRequest: BAContentRequest, manifestURL: URL, extensionInfo: BAAppExtensionInfo) -> Set<BADownload>