Background Assets: Download BAManifestDownload rejected as we are out of download allowance

Background Asset Session: https://developer.apple.com/videos/play/wwdc2022/110403

I create a new project after watching the session. And i add the following in the info.plist:

  • BAMaxInstallSize: 1024000
  • BAManifestURL: https://***.com
  • BAInitialDownloadRestrictions : Dictionary
    • BADownloadAllowance: 1024000
    • BADownloadDomainAllowList : Array
      • *.***.com

But when i debug the extension with this command: xcrun backgroundassets-debug -s --app-install -b com.***.BADemo1 -d xxxxxxx , i get some error in conslog.app:

Download BAManifestDownload  - com.***.BADemo1.Manifest-xx rejected as we are out of download allowance.

Download did fail: BAManifestDownload  - com.***.BADemo1.Manifest-xx with error: Error Domain=com.apple.backgroundassets.error Code=203 "The requested download will not be allowed due to running out of download allowance." UserInfo={NSLocalizedFailureReason=The requested download will not be allowed due to running out of download allowance.}

Rejecting launching extension for <private> because it has already run too long.

how i can fix this problem

Accepted Reply

The extension is only permitted to run for 10 minutes a day. To bypass this restriction you'll need to install iOS 16.2 Beta, which will allow the xcrun backgroundassets-debug tool to bypass this restriction. Even if you want to deploy to iOS 16.1, I'd still recommend developing on the 16.2 Beta so that this restriction can be bypassed for development.

  • Hello @jaredjones , the limit 10 min a day is very low right? What if a download file takes 1hr based on the user's internet speed?

  • @tejram_k The extension doesn't need to stay alive for the download to occur. The download is performed by the system, and your extension is launched when the download fails or succeeds. When any of the BADownloaderExtension protocols exit scope, the extension becomes suspended after a few seconds and eventually is terminated if the extension isn't invoked within a certain period of time. Your extension is not considered running when it goes suspended.

Add a Comment

Replies

Hello @moonmd, is the total size of your background assets greater than the listed BADownloadAllowance?

If so, you’ll need to either increase your limits or decrease your download size.

(If you increase your download limit, you’ll need to increase your BAMaxInstallSize install limit too.)

—Jason.

  • Thank you for your answer. But I didn't download any files at before. Actually, my extension doesn't receive any callbacks in the demo. As mentioned before, the demo reported this error the first time it was run. So now what should I do?

  • Thank you for your answer. But i didn't download any file. Actually, my extension doesn't receive task callbacks after app install. I got these errors from console.app when I debug the Background Asset from the command line. And what should i do now?

  • Thank you for your answer. But i didn't download any file. Actually, my extension doesn't receive task callbacks after app install. I got these errors from console.app when I debug the Background Asset from the command line. And what should i do now?

Add a Comment

@Jason, Thank you for your answer. But i didn't download any file. Actually, my extension doesn't receive task callbacks after app install. I got these errors from console.app when I debug the Background Asset from the command line. And what should i do now? (And if I add a comment directly, it doesn't show?)

The extension is only permitted to run for 10 minutes a day. To bypass this restriction you'll need to install iOS 16.2 Beta, which will allow the xcrun backgroundassets-debug tool to bypass this restriction. Even if you want to deploy to iOS 16.1, I'd still recommend developing on the 16.2 Beta so that this restriction can be bypassed for development.

  • Hello @jaredjones , the limit 10 min a day is very low right? What if a download file takes 1hr based on the user's internet speed?

  • @tejram_k The extension doesn't need to stay alive for the download to occur. The download is performed by the system, and your extension is launched when the download fails or succeeds. When any of the BADownloaderExtension protocols exit scope, the extension becomes suspended after a few seconds and eventually is terminated if the extension isn't invoked within a certain period of time. Your extension is not considered running when it goes suspended.

Add a Comment