My app is able to receive data updates when it is in foreground.
however, when i move it in background then sync engine stops syncing until I again move app to foreground.
Background Assets
RSS for tagSchedule background downloads of large assets during app installation, when the app updates, and periodically while the app remains on-device.
Posts under Background Assets tag
14 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
Hi Ty for playing
I want to download some large files on watchOS and I found Apple Music app is able to download songs in background and pause downloading depending on battery life. Does there any way to do the same thing in my own app? After users choose to download, keep the downloading task in background and pause/resume on demand.
I am having an issue with scheduling daily background task (eg: nightly) when app is in terminated app state (user forcefully terminated the app from app switcher).
If the app is in suspended state, I am able to schedule a daily background task. But is there a way to wake up the app nightly and register a BGTask when user forcefully terminates the app.
The app declares support for Voice-over IP (VoIP) in the UIBackgroundModes key in your Info.plist, but we are still unable to locate any VoIP services. Apps that declare support for VoIP in the UIBackgroundModes key in your Info.plist file must have features that require VoIP.
My app rejected for VOIP and the app is totally supported video call or call when app is terminated or in background how can. i solve that rejection issue
At WWDC 2023, the background asset feature was introduced, allowing essential resources to be downloaded before the game is first launched. How does this differ from including all necessary resources directly in the installation package? What are the advantages of this approach, and how does it enhance the user experience?
Dear Apple Developer Support,
I have a question regarding the Background Assets feature for a game we are planning to release on the App Store. Specifically, I would like to understand the user experience during the initial installation process.
If our game utilizes the Background Assets feature and we have essential assets specified in the BAExtension, will the end user need to wait for these essential assets to be fully downloaded before they can open the game after installing it from the App Store? Additionally, during this download process, will there be any indication of the essential assets' download status on the App Store or on the home screen icon of the game?
Your guidance on how this process is managed and what the user can expect would be greatly appreciated.
Thank you for your assistance.
Hello, I have applied background assets on my app. It does allow you to download resources in advance, increasing the speed of resource presentation. But I found that the download success rate was only 20% (Within an app with tens of millions of users). And most of the error codes are:
BAErrorDomain Code=111 "The requested download could not be enqueued. Check the device‘s Low Power Mode or Background App Refresh settings" .
Generally speaking, the proportion of low power mode should be around 20%. So why are there so many 111 error codes
In XCode organizer, under reports section, Crashes info shows fine with call stacks but Disk writes, Energy and Hang reports sections are broken since Background Assets frameworks integration.
Error msg:
The operation couldn't be completed. ((extension in DVTProducts):DVTAppStoreConnect.AppExtension.(unknown context at $10beb2a18).AppExtensionError error 0.)
Xcode failed loading app information.
How to fix this error and get the reports under Disk writes, Energy and Hang reports section?
Hardware: iPhone 12/iOS 15.1.1
I am having problems getting urlSession(_:task:didCompleteWithError:) to fire when session configured for background.
I set up my background session and uploadTask as such:
let config = URLSessionConfiguration.background(withIdentifier: "my.unique.session.identifier")
config.isDiscretionary = false
config.sessionSendsLaunchEvents = true
config.allowsCellularAccess = true
config.httpMaximumConnectionsPerHost = 1
config.timeoutIntervalForRequest = 30
config.timeoutIntervalForResource = 60
let session = URLSession(configuration: config, delegate: yourDelegate, delegateQueue: nil)
let task = session.uploadTask(with: request, from: data)
task.resume()
First, I confirmed that I can upload using the above code.
Then to simulate a timeout, I set a breakpoint in Charles Proxy on the response. When triggered, I just wait. urlSession(_:task:didCompleteWithError:) is never called, no matter how long I wait. I can "see" the background session periodically retrying the upload, because I having logging in urlSession(_:task:didSendBodyData:). Every time didSendBodyData is called, it triggers the breapoint in Charles Proxy. And I wait. didCompleteWithError never gets called.
One more observation: if I change the session config from 'background' to 'default', didCompleteWithError is triggered.
Thanks!
I have the following problem when using background asset:
"The requested URL is not permitted to be downloaded until the application is launched."
My code is as follows:
NSDictionary *infoDict = [NSBundle mainBundle].infoDictionary;
self.downloadAsset = [[BAURLDownload alloc] initWithIdentifier:@"BAManifestURL" request:[NSURLRequest requestWithURL:[NSURL URLWithString:infoDict[@"BAManifestURL"]]] essential:NO fileSize:1610612736 applicationGroupIdentifier:@"group.com.iphone.share" priority:BADownloaderPriorityDefault];
The configuration file is as follows:
Please tell me how to solve this problem.
Hello, we need to allow background downloading of assets from the network and into our visionOS app. For that purpose, we would like to implement Background Assets framework since the Apple web page of the framework indicates that it is supported on visionOS.
Unfortunately, Xcode 15.1 beta 3 does not allow us to add the Background Download extension. How can we use Background Assets framework in our visionOS app? Is there another way to create the background download extension?
Thanks,
Hi everyone, I'm integrating BackgroundAssets into my app and run into the following issue. According to the docs fileSize only needs to be accurate for essential downloads
/// @abstract Constructs a download object to represent the download of a asset located inside of the provided @c request.
/// @param identifier A unique identifier that is used to track the download across the app and extension.
/// @param request The request used to perform the download. The URL provided inside of the request must be a https scheme.
/// @param essential Whether the download is essential. See @c BADownload.isEssential. Default is false.
/// @param fileSize The size of the file to download. For Essential downloads, this field must be accurate in order to show the user
/// accurate progress during app installation. If the size does not match the file being downloaded, then the download will fail. It is recommended to
/// report an accurate @c fileSize for both Essential and Non-Essential downloads.
/// @param applicationGroupIdentifier The identifier of the application group that should used to store the finished download.
/// @param priority A priority between @c BADownloaderPriorityMin - @c BADownloaderPriorityMax which is used to order the downloads for this process.
/// It is recommended to use @c BADownloaderPriorityDefault if download priority does not matter.
@available(iOS 16.4, *)
public init(identifier: String, request: URLRequest, essential: Bool, fileSize: Int, applicationGroupIdentifier: String, priority: BADownload.Priority)
However, when I'm queueing up non-essential downloads with inaccurate fileSize, my BADownloadManagerDelegate gets a failedWithError callback, with error
The download failed because the file size provided does not match what was downloaded.
This happens for me when the app needs to download a new version of the manifest, which contains the information about all the other background assets that needs to be processed.
Is the documentation wrong and fileSize must always be accurate, even for non-essential downloads?
All help is appreciated to resolve this.
Hi,
In XCode organizer, under reports section, Crashes info shows fine with call stacks but Disk writes, Energy and Hang reports sections are broken recently. When I try to access any of these sections it says "The operation couldn't be completed. ((extension in DVT Products):....[Attached error screenshot]"
How to fix this error and get the reports under Disk writes, Energy and Hang reports section?
Regards,
Eshwar