Background Assets

RSS for tag

Schedule 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

102 Posts

Post

Replies

Boosts

Views

Activity

BackgroundAssets framework visionOS implementation
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,
1
0
819
Dec ’23
How to Debug Background Assets in macOS?
I attempted to utilize the Background Assets feature for an iOS app. While debugging, I employed the following command to trigger the installation event: xcrun backgroundassets-debug -b <bundleID> -s --app-install -d <Device ID> This command worked flawlessly on an iPhone. However, when I attempted to trigger the installation event on a Mac, I encountered the following error message: The requested device to send simulation events to is not available. Verify that the device is connected to this Mac. Please note that the xcrun backgroundassets-debug -l command only displays a list of connected devices.Mac is not listed in that list.
0
2
1k
Oct ’23
Background Asset. Failed because the app and extension do not share any application groups.
Hi everyone. We try to implement background assets to our project. And and encountered this problem. When try to send background event from terminal xcrun backgroundassets-debug --simulate --app-periodic-check -d [DEVICE_ID] -b [APP_BUNDLE_IDENTIFIER] In console.app in device log we saw this type of logs Text version :) Resetting extension runtime for: [APP_BUNDLE_IDENTIFIER] Application info for ([APP_BUNDLE_IDENTIFIER]) is being updated based on URL:(N/A) Failed to find represented extension point. (ID:[APP_BUNDLE_IDENTIFIER] Event (7) dropped for client ([APP_BUNDLE_IDENTIFIER]) failed because the app and extension do not share any application groups. Tried on Xcode 15, iOS 17.0.2, MacOS 14 App Info.plist (in yml style) ---- part <key>app-group</key> <string>group.com.*******.MobileFWDemo</string> <key>app-group-asset</key> <string>group.com.*******.BackgroundAsset.Container</string> <key>BAInitialDownloadRestrictions</key> <dict> <key>BADownloadAllowance</key> <integer>1610612736</integer> <key>BADownloadDomainAllowList</key> <array> <string>devstreaming-cdn.apple.com</string> <string>developer.apple.com</string> <string>http://example.com/</string> <string>https://www.learningcontainer.com/</string> <string>https://file-examples.com</string> </array> <key>BAEssentialDownloadAllowance</key> <integer>1073741824</integer> </dict> <key>BAManifestURL</key> <string>https://developer.apple.com/sample-code/background-assets/SessionsManifest.plist</string> <key>BAMaxInstallSize</key> <string>1610612736</string> ----- part In BAExtension info.plist <dict> <key>app-group</key> <string>group.com.*******.MobileFWDemo</string> <key>app-group-asset</key> <string>group.com.*******.BackgroundAsset.Container</string> <key>EXAppExtensionAttributes</key> <dict> <key>EXExtensionPointIdentifier</key> <string>com.apple.background-asset-downloader-extension</string> <key>EXPrincipalClass</key> <string>BackgroundDownloadHandler</string> </dict> </dict> App Entitlement <dict> <key>aps-environment</key> <string>development</string> <key>com.apple.developer.applesignin</key> <array> <string>Default</string> </array> <key>com.apple.developer.associated-domains</key> <array> <string>applinks:******.onelink.me</string> </array> <key>com.apple.developer.game-center</key> <true/> <key>com.apple.security.application-groups</key> <array> <string>group.com.******.BackgroundAsset.Container</string> <string>group.com.******.MobileFWDemo</string> </array> </dict> Extension Entitlement <dict> <key>com.apple.security.application-groups</key> <array> <string>group.com.*******.MobileFWDemo</string> <string>group.com.*******.BackgroundAsset.Container</string> </array> </dict> Method - not called - (NSSet<BADownload *> *)downloadsForRequest:(BAContentRequest)contentRequest manifestURL:(NSURL *)manifestURL extensionInfo:(BAAppExtensionInfo *)extensionInfo After add Background Asset Extension a new warning appeared in the logs: Execution of the command buffer was aborted due to an error during execution. Insufficient Permission (to submit GPU work from background) (00000006:kIOGPUCommandBufferCallbackErrorBackgroundExecutionNotPermitted) Maybe it wiil be connected to my problem. Could someone help ?)
1
1
1.3k
Sep ’23
Background Assets The online Appstore crashed : EXC_BREAKPOINT
Background Assets are integrated into our online Appstore. However, after launching the APP, we collected many crashes of Background Assets framework through our crash system. 1、BADownloadManager.sharedManager.fetchCurrentDownloadsWithCompletionHandler. Then, I am reinitiating the tasks through startForegroundDownload. However, occasionally there is a crash with EXC_BREAKPOINT [BADownloadManager.sharedManager fetchCurrentDownloadsWithCompletionHandler:^(NSArray<BADownload *> * _Nonnull downloads, NSError * _Nullable error) { if (error){ return; } for (BADownload *download in downloads) { if ([urlList containsObject:download.identifier]){ if (download.state == BADownloadStateFailed) { return; } NSError *downloadError; BOOL succes = [BADownloadManager.sharedManager startForegroundDownload:download error:&downloadError]; if (downloadError) { LogError(BADownloadLog,@"startForegroundDownload url:%@ error:%@",download.identifier,downloadError); }else if(succes){ LogInfo(BADownloadLog,@"startForegroundDownload:%@",download.identifier); [self addDowdloadingUrl:download.identifier]; } } } }]; The following crashes exist: Thread 3 (crashed) 0 BackgroundAssets!-[BADownloadManager startForegroundDownload:error:] + 0x100 Found by: given as instruction pointer in context 1 BackgroundAssets!-[BADownloadManager startForegroundDownload:error:] + 0xe0 Found by: previous frame's frame pointer 2 YYMobile!__46-[YYBADownloadManager executeDownload:finish:]_block_invoke [YYBADownloadManager.m : 180 + 0xc] Found by: previous frame's frame pointer 3 libdispatch.dylib!_dispatch_call_block_and_release + 0x1c Found by: previous frame's frame pointer 4 libdispatch.dylib!_dispatch_client_callout + 0x10 Found by: previous frame's frame pointer 5 libdispatch.dylib!_dispatch_lane_serial_drain + 0x298 Found by: previous frame's frame pointer 6 libdispatch.dylib!_dispatch_lane_invoke + 0x17c Found by: previous frame's frame pointer 7 libdispatch.dylib!_dispatch_workloop_worker_thread + 0x284 Found by: previous frame's frame pointer 8 libsystem_pthread.dylib!_pthread_wqthread + 0x11c Found by: previous frame's frame pointer See attachment "iOS.crash" for the complete crash file. iOS.crash Ask what, do I need to use exclusive control when accessing BADownload? 2、Handling failed callbacks in background download extension, rearranging necessary resources crashed - (void)backgroundDownload:(BADownload *)download failedWithError:(NSError *)error { // Extension was woken because a download failed. // A download can be rescheduled with BADownloadManager if necessary. if (![download isKindOfClass:[BAURLDownload class]]) { return; } if (download.isEssential){ BADownload *nonEssential = [download copyAsNonEssential]; [BADownloadManager.sharedManager scheduleDownload:nonEssential error:nil]; } } Have a crash: hread 1 Crashed: 0 BackgroundAssets 0x0000000245b47dac -[BADownload setPriority:] + 176 (BADownload.m:249) 1 BackgroundAssets 0x0000000245b47bb4 -[BADownload copyWithZone:] + 188 (BADownload.m:217) 2 BackgroundAssets 0x0000000245b46db0 -[BAURLDownload copyWithZone:] + 52 (BAURLDownload.m:127) 3 BackgroundAssets 0x0000000245b47f7c -[BADownload copyAsNonEssential] + 20 (BADownload.m:368) 4 YYBackgroundDownload 0x0000000100de8a88 0x100de4000 + 19080 5 BackgroundAssets 0x0000000245b3fd50 __88-[BADownloaderExtensionConnection backgroundDownload:failedWithError:completionHandler:]_block_invoke + 56 (BADownloaderExtensionConnection.m:178) 6 libdispatch.dylib 0x00000001d8080320 _dispatch_call_block_and_release + 32 (init.c:1518) 7 libdispatch.dylib 0x00000001d8081eac _dispatch_client_callout + 20 (object.m:560) 8 libdispatch.dylib 0x00000001d8089534 _dispatch_lane_serial_drain + 668 (inline_internal.h:2640) 9 libdispatch.dylib 0x00000001d808a0a4 _dispatch_lane_invoke + 384 (queue.c:3966) 10 libdispatch.dylib 0x00000001d8094cdc _dispatch_workloop_worker_thread + 648 (queue.c:6913) 11 libsystem_pthread.dylib 0x0000000230547ddc _pthread_wqthread + 288 (pthread.c:2618) 12 libsystem_pthread.dylib 0x0000000230547b7c start_wqthread + 8 (:-1) Details see attachment 2023-09-19_09-46-22.4511_+0800-6c5f4b24bec7c04256c852d7a008978a886c15a3.crash
1
0
1.1k
Sep ’23
Background Assets have a crash: EXC_BREAKPOINT
I am starting the app and fetching the current downloading tasks through BADownloadManager.sharedManager.fetchCurrentDownloadsWithCompletionHandler. Then, I am reinitiating the tasks through startForegroundDownload. However, occasionally there is a crash with EXC_BREAKPOINT [BADownloadManager.sharedManager fetchCurrentDownloadsWithCompletionHandler:^(NSArray<BADownload *> * _Nonnull downloads, NSError * _Nullable error) { if (error){ return; } for (BADownload *download in downloads) { if ([urlList containsObject:download.identifier]){ if (download.state == BADownloadStateFailed) { return; } NSError *downloadError; BOOL succes = [BADownloadManager.sharedManager startForegroundDownload:download error:&downloadError]; if (downloadError) { LogError(BADownloadLog,@"startForegroundDownload url:%@ error:%@",download.identifier,downloadError); }else if(succes){ LogInfo(BADownloadLog,@"startForegroundDownload:%@",download.identifier); [self addDowdloadingUrl:download.identifier]; } } } }]; Crash stack: Crash reason: EXC_BREAKPOINT / EXC_ARM_BREAKPOINT Crash address: 0x21be8f638 Process uptime: 2 seconds Thread 3 (crashed) 0 BackgroundAssets!-[BADownloadManager startForegroundDownload:error:] + 0x100 Found by: given as instruction pointer in context 1 BackgroundAssets!-[BADownloadManager startForegroundDownload:error:] + 0xe0 Found by: previous frame's frame pointer 2 YYMobile!__46-[YYBADownloadManager executeDownload:finish:]_block_invoke [YYBADownloadManager.m : 180 + 0xc] Found by: previous frame's frame pointer 3 libdispatch.dylib!_dispatch_call_block_and_release + 0x1c Found by: previous frame's frame pointer 4 libdispatch.dylib!_dispatch_client_callout + 0x10 Found by: previous frame's frame pointer 5 libdispatch.dylib!_dispatch_lane_serial_drain + 0x298 Found by: previous frame's frame pointer 6 libdispatch.dylib!_dispatch_lane_invoke + 0x17c Found by: previous frame's frame pointer 7 libdispatch.dylib!_dispatch_workloop_worker_thread + 0x284 Found by: previous frame's frame pointer 8 libsystem_pthread.dylib!_pthread_wqthread + 0x11c Found by: previous frame's frame pointer The crash occurred at BOOL succes = [BADownloadManager.sharedManager startForegroundDownload:download error:&downloadError];
1
0
780
Sep ’23
The download failed, what are the requirements for the BackgroundDownloadExt certificate or BundleId?
xcrun backgroundassets-debug --simulate --app-install -d 00008120-0014188636D8C01E -b com.testBackGround.photos Application was installed event was sent for app identifier: (com.testBackGround.photos). WWDC Sessions Background Assets Extension container_create_or_lookup_app_group_path_by_app_group_identifier: client is not entitled backgroundassets.user Extension interrupted for identifier: com.testBackGround.photos runningboardd Invalidating assertion 31-413-2850 (target:[xpcservice<com.testBackGround.photos.BackgroundDownloadExt([osservice<com.apple.backgroundassets.user>:413])>:1479]) from originator [osservice<com.apple.backgroundassets.user>:413] backgroundassets.user Extension invalidated for identifier: com.testBackGround.photos backgroundassets.user Extension for app identifier com.testBackGround.photos ran for 1.1 seconds. backgroundassets.user Failed to send -[BADownloaderExtensionProxy requestDownloadsWithContentRequest:manifestURL:extensionInfo:completion:]_block_invoke for: com.testBackGround.photos error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.testBackGround.photos.BackgroundDownloadExt was invalidated from this process." UserInfo={NSDebugDescription=The connection to service named com.testBackGround.photos.BackgroundDownloadExt was invalidated from this process.} backgroundassets.user Removing manifest download as extension did not handle manifest. BAManifestDownload (0xc2d2075c0): [ID:com.testBackGround.photos.Manifest-466C2F4F-60C7-494A-85EA-5E59F243C176, AppID:com.testBackGround.photos, Necessity:Essential]
2
0
1.1k
Sep ’23
The extension of Background assets failed to run
xcrun backgroundassets-debug --simulate --app-install -d 00008120-0014188636D8C01E -b com.feitiandalong.photos Application was installed event was sent for app identifier: (com.feitiandalong.photos). It can be seen through charles capture that BAManifestURL has been successfully downloaded but none of the files in the manifest are downloaded. ACKs-compressed: 0, ACKs delayed: 0 delayed ACKs sent: 0 20:11:10.316138+0800 backgroundassets.user nw_flow_disconnected [C18 IPv4#98070097:443 cancelled parent-flow ((null))] Output protocol disconnected 20:11:10.317934+0800 backgroundassets.user nw_connection_report_state_with_handler_on_nw_queue [C18] reporting state cancelled 20:11:10.318057+0800 backgroundassets.user Connection 18: done 20:11:10.318375+0800 backgroundassets.user tcp_output [C18.1.1.1:3] flags=[FP.] seq=887285318, ack=2619599097, win=2048 state=FIN_WAIT_1 rcv_nxt=2619599097, snd_una=887285287 20:11:10.339591+0800 backgroundassets.user Removing manifest as extension processed the manifest. BAManifestDownload (0xcdca24b10): [ID:com.feitiandalong.photos.Manifest-576E82DE-A63B-4C9C-A463-266CAAEAA41D, AppID:com.feitiandalong.photos, Necessity:Essential] 20:11:10.340096+0800 backgroundassets.user Scheduled content request downloads count: 0 for client: com.feitiandalong.photos 20:11:10.341866+0800 backgroundassets.user user sessions enabled, targeting 501 20:11:10.345417+0800 backgroundassets.user cleaning up unpooled xpc conn to trustd 0xcdcc3a020 20:11:10.345523+0800 backgroundassets.user got event: Connection invalid 20:11:10.345550+0800 backgroundassets.user Trust evaluate failure: [leaf IssuerCommonName LeafMarkerOid SubjectCommonName] 20:11:10.357817+0800 backgroundassets.user user sessions enabled, targeting 501 20:11:10.360095+0800 backgroundassets.user cleaning up unpooled xpc conn to trustd 0xcdf20caa0 20:11:10.360199+0800 backgroundassets.user Trust evaluate failure: [leaf IssuerCommonName LeafMarkerOid SubjectCommonName] 20:11:10.360227+0800 backgroundassets.user got event: Connection invalid 20:11:10.366564+0800 backgroundassets.user was picked for validation 20:11:10.367495+0800 backgroundassets.user Client connection accepted from pid:620 20:11:10.708893+0800 backgroundassets.user tcp_input [C18.1.1.1:3] flags=[F.] seq=2619599097, ack=887285382, win=133 state=FIN_WAIT_2 rcv_nxt=2619599097, snd_una=887285382 20:11:25.379062+0800 backgroundassets.user Extension invalidated for identifier: com.feitiandalong.photos 20:11:25.379163+0800 backgroundassets.user Extension for app identifier com.feitiandalong.photos ran for 15.9 seconds. 20:11:25.379818+0800 runningboardd Invalidating assertion 31-432-2356 (target:[xpcservice<com.feitiandalong.photos.BackgroundDownloadExt([osservice<com.apple.backgroundassets.user>:432])>:620]) from originator [osservice<com.apple.backgroundassets.user>:432] 20:11:25.486812+0800 runningboardd Removed last relative-start-date-defining assertion for process xpcservice<com.feitiandalong.photos.BackgroundDownloadExt([osservice<com.apple.backgroundassets.user>:432])> 20:11:25.488538+0800 runningboardd Calculated state for xpcservice<com.feitiandalong.photos.BackgroundDownloadExt([osservice<com.apple.backgroundassets.user>:432])>: running-suspended (role: None) 20:11:25.488835+0800 runningboardd [xpcservice<com.feitiandalong.photos.BackgroundDownloadExt([osservice<com.apple.backgroundassets.user>:432])>:620] Set jetsam priority to 0 [0] flag[1] 20:11:25.489062+0800 runningboardd [xpcservice<com.feitiandalong.photos.BackgroundDownloadExt([osservice<com.apple.backgroundassets.user>:432])>:620] Suspending task. 20:11:25.489964+0800 runningboardd [xpcservice<com.feitiandalong.photos.BackgroundDownloadExt([osservice<com.apple.backgroundassets.user>:432])>:620] Shutdown sockets (SVC) 20:11:25.490145+0800 runningboardd [xpcservice<com.feitiandalong.photos.BackgroundDownloadExt([osservice<com.apple.backgroundassets.user>:432])>:620] Result 45 setting darwin role to None: Operation not supported, falling back to setting priority 20:11:25.490350+0800 runningboardd [xpcservice<com.feitiandalong.photos.BackgroundDownloadExt([osservice<com.apple.backgroundassets.user>:432])>:620] Set darwin priority to: PRIO_DARWIN_BG 20:11:25.490716+0800 runningboardd [xpcservice<com.feitiandalong.photos.BackgroundDownloadExt([osservice<com.apple.backgroundassets.user>:432])>:620] set Memory Limits to Hard Inactive (6) 20:11:25.491013+0800 runningboardd [xpcservice<com.feitiandalong.photos.BackgroundDownloadExt([osservice<com.apple.backgroundassets.user>:432])>:620] check if suspended process is holding locks 20:11:25.505215+0800 backgroundassets.user Received state update for 620
3
0
1k
Sep ’23
backgroundassets download failed
xcrun backgroundassets-debug --simulate --app-install -d 00008120-0014188636D8C01E -b com.linkone.photos Application was installed event was sent for app identifier: (com.linkone.photos). 1.Failed to get LSApplicationRecord for <RBSLaunchRequest| xpcservice<com.linkone.photos.BackgroundDownloadExt([osservice<com.apple.backgroundassets.user>:432])>; "Launching extension com.linkone.photos.BackgroundDownloadExt(417909C8-350A-40DB-BB09-011C6852A5F9) for host 432"> with error Error Domain=NSOSStatusErrorDomain Code=-10814 "(null)" UserInfo={_LSLine=1569, _LSFunction=runEvaluator} 2.Extension interrupted for identifier: com.linkone.photos 3.Failed to send -[BADownloaderExtensionProxy requestDownloadsWithContentRequest:manifestURL:extensionInfo:completion:]_block_invoke for: com.linkone.photos error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.linkone.photos.BackgroundDownloadExt was invalidated from this process." UserInfo={NSDebugDescription=The connection to service named com.linkone.photos.BackgroundDownloadExt was invalidated from this process.} 4.Removing manifest download as extension did not handle manifest. BAManifestDownload (0xcdcd199a0): [ID:com.linkone.photos.Manifest-A11C1BD7-4D46-4030-8AFB-3AC740645C5B, AppID:com.linkone.photos, Necessity:Essential] 5.Failed to lookup LSBundleRecord for audit token. Error Domain=NSOSStatusErrorDomain Code=-600 "The file system path for this process could not be determined. It may not be running, or it may have been deleted or moved while running." UserInfo={NSDebugDescription=The file system path for this process could not be determined. It may not be running, or it may have been deleted or moved while running., _LSLine=266, _LSFunction=+[LSBundleRecord _bundleRecordForAuditToken:checkNSBundleMainBundle:error:]} 6.RBSStateCapture remove item called for untracked item 31-432-3187 (target:[xpcservice<com.linkone.photos.BackgroundDownloadExt([osservice<com.apple.backgroundassets.user>:432])>:962])
2
0
1.1k
Sep ’23
File download failed
Failed to send -[BADownloaderExtensionProxy backgroundDownload:finishedWithSandboxToken:completionHandler:]_block_invoke for: com.xuhuiTest.photos error: Error Domain=NSCocoaErrorDomain Code=4097 "connection to service with pid 2085 named com.xuhuiTest.photos.BackgroundDownloadExt" UserInfo={NSDebugDescription=connection to service with pid 2085 named com.xuhuiTest.photos.BackgroundDownloadExt} Client is missing signing identifier, client must be signed with an identifier to use BackgroundAssets. (null) log.json
2
0
1k
Aug ’23
Background Assets: Questions about network status
Background asstes are triggered before the APP is launched. At this time, if the current device is not connected to the WIFI network, it will directly consume the operator's network traffic. Is there any way to limit this in order to avoid disputes over fees arising from the consumption of users' non-wifi traffic without their knowledge? For example, after extension is triggered, determine the network status when scheduling downloads?
0
0
793
Jul ’23
Background Assets:Failed to schedule download
I wrote the following code to schedule the download in extension: AURLDownload *essentialDownload = [[BAURLDownload alloc] initWithIdentifier:url request:[NSURLRequest requestWithURL:assetURL] essential:true fileSize:assetSize applicationGroupIdentifier:YYBASharedSettings.appGroupIdentifier priority:BADownloaderPriorityDefault]; NSLog(@"BackgroundAssetsTest extension Schedule essentialDownload url:%@",url); and the delegate callback is implemented as follows: - (void)backgroundDownload:(BADownload *)download failedWithError:(NSError *)error { NSLog(@"BackgroundAssetsTest extension failedWithError: %@",error); } The console outputs the following error: BackgroundAssetsTest extension failedWithError: Error Domain=BAErrorDomain Code=202 "The requested URL is not permitted to be downloaded until the application is launched." UserInfo={NSLocalizedFailureReason=The requested URL is not permitted to be downloaded until the application is launched.} What's the problem? Scheduled downloads can only be triggered by launching the APP?
1
0
899
Jul ’23
Background Assets Failed to move manifestURL to APP group
After receiving manifestURL in extension, I try to move it to the shared directory of APP group, as follows: NSURL *url = [NSFileManager.defaultManager containerURLForSecurityApplicationGroupIdentifier:self.appGroupIdentifier]; NSURL *storageURL = [url URLByAppendingPathComponent:@"YYBAResCache" isDirectory:YES]; BOOL isDirectory; BOOL isExists = [NSFileManager.defaultManager fileExistsAtPath:storageURL.path isDirectory:&isDirectory]; NSError *error = nil; if (!isExists || !isDirectory) { [NSFileManager.defaultManager createDirectoryAtURL:storageURL withIntermediateDirectories:YES attributes:@{NSFilePosixPermissions: [NSNumber numberWithShort:0777]} error:&error]; } if (error){ NSLog(@"Failed to create session storage directory:%@",error); } NSURL *localManifestURL = [sessionStorageURL URLByAppendingPathComponent:@"manifest.json"]; Next, move the file: NSError *error; [NSFileManager.defaultManager moveItemAtURL:manifestURL toURL:localManifestURL error:&error]; if (error) { NSLog(@"BackgroundAssetsTest extension saveMainifest:%@ to %@ error:%@",manifestURL,YYBASharedSettings.localManifestURL,error); } But I still received an error: BackgroundAssetsTest extension saveMainifest:file:///var/tmp/com.apple.backgroundassets.downloadstaging/com.devinprogress2021/2cf0ae65-3058-4522-80d5-f4d76747ad15.json to file:///private/var/mobile/Containers/Shared/AppGroup/F466C6BA-35D7-4115-8D8E-E1726E3D3696/YYBAResCache/manifest.json error:Error Domain=NSCocoaErrorDomain Code=513 "“2cf0ae65-3058-4522-80d5-f4d76747ad15.json” couldn’t be moved because you don’t have permission to access “YYBAResCache”." UserInfo={NSSourceFilePathErrorKey=/var/tmp/com.apple.backgroundassets.downloadstaging/com.yy.yymobile.devinprogress2021/2cf0ae65-3058-4522-80d5-f4d76747ad15.json, NSUserStringVariant=( Move ), NSDestinationFilePath=/private/var/mobile/Containers/Shared/AppGroup/F466C6BA-35D7-4115-8D8E-E1726E3D3696/YYBAResCache/manifest.json, NSFilePath=/var/tmp/com.apple.backgroundassets.downloadstaging/com.devinprogress2021/2cf0ae65-3058-4522-80d5-f4d76747ad15.json, NSUnderlyingError=0x14520d2d0 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}} why?
1
0
995
Jul ’23
Background Assets: Max Parallel downloads and Max Parallel Schedules allowed
In our app, We have to download 5000 assets in the Install/Periodic event. Obviously, we can't download them all in parallel. If we return all 5000 entries in the extension downloads function, will the system take care of queueing and downloading some 20 assets parallelly and take care of downloading all of 5000 assets? Or Should we return only 20 urls and after if got finished, from the finished call back we can repeatedly schedule the next 20 every time and can download all of 5000 assets? If we can't reduce the number of assets(like in our case 5000 entries), What is the recommended way of downloading it?
0
0
691
Jul ’23
Background Assets: BAURLDownload is finish, but the file cannot be read, the file does not exist
My Background Assets extension arranges to download image resources, as follows: NSURL *assetURL = [NSURL URLWithString:@"https://***.png”]; NSUInteger assetSize = 6849; switch (contentRequest) { case BAContentRequestInstall: case BAContentRequestUpdate: { BAURLDownload *essentialDownload = [[BAURLDownload alloc] initWithIdentifier:@"YYBADAsset" request:[NSURLRequest requestWithURL:assetURL] essential:true fileSize:assetSize applicationGroupIdentifier:appGroupIdentifier priority:BADownloaderPriorityDefault]; [downloadsToSchedule addObject:essentialDownload]; break; } } At the same time, the finishedWithFileURL method is implemented as follows: - (void)backgroundDownload:(BADownload *)download finishedWithFileURL:(NSURL *)fileURL { NSLog(@"BackgroundAssetsTest extension finishedWithFileURL:%@ forDownlad:%@",fileURL,download.identifier); NSLog(@"BackgroundAssetsTest extension finishedWithManifestURLExist:%@",@([[NSFileManager defaultManager] fileExistsAtPath:fileURL.absoluteString])); } And then use tools to trigger events, xcrun backgroundassets-debug --app-bundle-id com.luph.mytest --device-id 00008020-000A04xxF0002E --simulate --app-install The following log is observed through the console: BackgroundAssetsTest extension finishedWithFileURL:file:///private/var/mobile/Containers/Shared/AppGroup/1D051E06-E597-4670-969A-38ECA52C4F7A/Library/C aches/com.apple.BackgroundAssets/BAFile-5152AFB2.tmp forDownlad:YYBADAsset BackgroundAssetsTest extension finishedWithManifestURLExist:0 What's the problem? Did I set the size of BAURLDownload to be different from the actual download size? Or the wrong way to determine the existence of the file?
1
0
935
Jul ’23
Not able to download the file using Background Assets for TestFlight build
Hi, I used Background assets to download files during install/update events. The debug build works fine when I trigger the install event through terminal. The same code base (with different bundle ID ) is used in Test Flight build. But the file is not downloaded when I install the TestFlight build. I'm getting following error in Console while installing the TestFlight build. sometimes, i'm getting Failed to notify extension about finished download: BAURLDownload (0x61a80ab98): guard let url = URL(string:"https://devstreaming-cdn.apple.com/videos/wwdc/2021/10220/6/3866585A-3920-44B4-AB3F-03A446FCDE3A/downloads/wwdc2021-10220_hd.mp4") else{ return Set() } switch (request) { case .install, .update: let essentialDownload = BAURLDownload( identifier: "avtar345", request: URLRequest(url: url), essential: true, fileSize: 155384552, applicationGroupIdentifier: appGroupIdentifier, priority: .default) downloadsToSchedule.insert(essentialDownload) break; case .periodic: break; }
1
0
757
Jul ’23
Failed to notify extension about finished download: BAURLDownload
Hi team, I tried to download an image using the background assets . In development it downloads the image when I trigger the xcrun backgroundassets-debug command with instal event. But the image is not downloading for Test flight build. In console I observed the following errors while installing the app, Why am I getting this error while installing the app and how to resolve this?
0
0
708
Jul ’23
The requested URL is not permitted to be downloaded until the application is launched error in background assets
Hi , i tried to download image using background assets framework. I tried to use install and update events to test the extension. But the extension always delegate to backgroundDownload(_ :failedWithError :) function with following error Error Domain=BAErrorDomain Code=202 "The requested URL is not permitted to be downloaded until the application is launched." UserInfo={NSLocalizedFailureReason=The requested URL is not permitted to be downloaded until the application is launched.} I used the following url to download the image https://w0.peakpx.com/wallpaper/934/165/HD-wallpaper-avatar-aang-aang-airbender-aire-appa-avatar-legend-leyenda.jpg Why am i getting this error and how to resolve this?
3
0
1.2k
Jun ’23
BackgroundAssets framework visionOS implementation
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,
Replies
1
Boosts
0
Views
819
Activity
Dec ’23
How to Debug Background Assets in macOS?
I attempted to utilize the Background Assets feature for an iOS app. While debugging, I employed the following command to trigger the installation event: xcrun backgroundassets-debug -b <bundleID> -s --app-install -d <Device ID> This command worked flawlessly on an iPhone. However, when I attempted to trigger the installation event on a Mac, I encountered the following error message: The requested device to send simulation events to is not available. Verify that the device is connected to this Mac. Please note that the xcrun backgroundassets-debug -l command only displays a list of connected devices.Mac is not listed in that list.
Replies
0
Boosts
2
Views
1k
Activity
Oct ’23
Background Asset. Failed because the app and extension do not share any application groups.
Hi everyone. We try to implement background assets to our project. And and encountered this problem. When try to send background event from terminal xcrun backgroundassets-debug --simulate --app-periodic-check -d [DEVICE_ID] -b [APP_BUNDLE_IDENTIFIER] In console.app in device log we saw this type of logs Text version :) Resetting extension runtime for: [APP_BUNDLE_IDENTIFIER] Application info for ([APP_BUNDLE_IDENTIFIER]) is being updated based on URL:(N/A) Failed to find represented extension point. (ID:[APP_BUNDLE_IDENTIFIER] Event (7) dropped for client ([APP_BUNDLE_IDENTIFIER]) failed because the app and extension do not share any application groups. Tried on Xcode 15, iOS 17.0.2, MacOS 14 App Info.plist (in yml style) ---- part <key>app-group</key> <string>group.com.*******.MobileFWDemo</string> <key>app-group-asset</key> <string>group.com.*******.BackgroundAsset.Container</string> <key>BAInitialDownloadRestrictions</key> <dict> <key>BADownloadAllowance</key> <integer>1610612736</integer> <key>BADownloadDomainAllowList</key> <array> <string>devstreaming-cdn.apple.com</string> <string>developer.apple.com</string> <string>http://example.com/</string> <string>https://www.learningcontainer.com/</string> <string>https://file-examples.com</string> </array> <key>BAEssentialDownloadAllowance</key> <integer>1073741824</integer> </dict> <key>BAManifestURL</key> <string>https://developer.apple.com/sample-code/background-assets/SessionsManifest.plist</string> <key>BAMaxInstallSize</key> <string>1610612736</string> ----- part In BAExtension info.plist <dict> <key>app-group</key> <string>group.com.*******.MobileFWDemo</string> <key>app-group-asset</key> <string>group.com.*******.BackgroundAsset.Container</string> <key>EXAppExtensionAttributes</key> <dict> <key>EXExtensionPointIdentifier</key> <string>com.apple.background-asset-downloader-extension</string> <key>EXPrincipalClass</key> <string>BackgroundDownloadHandler</string> </dict> </dict> App Entitlement <dict> <key>aps-environment</key> <string>development</string> <key>com.apple.developer.applesignin</key> <array> <string>Default</string> </array> <key>com.apple.developer.associated-domains</key> <array> <string>applinks:******.onelink.me</string> </array> <key>com.apple.developer.game-center</key> <true/> <key>com.apple.security.application-groups</key> <array> <string>group.com.******.BackgroundAsset.Container</string> <string>group.com.******.MobileFWDemo</string> </array> </dict> Extension Entitlement <dict> <key>com.apple.security.application-groups</key> <array> <string>group.com.*******.MobileFWDemo</string> <string>group.com.*******.BackgroundAsset.Container</string> </array> </dict> Method - not called - (NSSet<BADownload *> *)downloadsForRequest:(BAContentRequest)contentRequest manifestURL:(NSURL *)manifestURL extensionInfo:(BAAppExtensionInfo *)extensionInfo After add Background Asset Extension a new warning appeared in the logs: Execution of the command buffer was aborted due to an error during execution. Insufficient Permission (to submit GPU work from background) (00000006:kIOGPUCommandBufferCallbackErrorBackgroundExecutionNotPermitted) Maybe it wiil be connected to my problem. Could someone help ?)
Replies
1
Boosts
1
Views
1.3k
Activity
Sep ’23
Background Assets The online Appstore crashed : EXC_BREAKPOINT
Background Assets are integrated into our online Appstore. However, after launching the APP, we collected many crashes of Background Assets framework through our crash system. 1、BADownloadManager.sharedManager.fetchCurrentDownloadsWithCompletionHandler. Then, I am reinitiating the tasks through startForegroundDownload. However, occasionally there is a crash with EXC_BREAKPOINT [BADownloadManager.sharedManager fetchCurrentDownloadsWithCompletionHandler:^(NSArray<BADownload *> * _Nonnull downloads, NSError * _Nullable error) { if (error){ return; } for (BADownload *download in downloads) { if ([urlList containsObject:download.identifier]){ if (download.state == BADownloadStateFailed) { return; } NSError *downloadError; BOOL succes = [BADownloadManager.sharedManager startForegroundDownload:download error:&downloadError]; if (downloadError) { LogError(BADownloadLog,@"startForegroundDownload url:%@ error:%@",download.identifier,downloadError); }else if(succes){ LogInfo(BADownloadLog,@"startForegroundDownload:%@",download.identifier); [self addDowdloadingUrl:download.identifier]; } } } }]; The following crashes exist: Thread 3 (crashed) 0 BackgroundAssets!-[BADownloadManager startForegroundDownload:error:] + 0x100 Found by: given as instruction pointer in context 1 BackgroundAssets!-[BADownloadManager startForegroundDownload:error:] + 0xe0 Found by: previous frame's frame pointer 2 YYMobile!__46-[YYBADownloadManager executeDownload:finish:]_block_invoke [YYBADownloadManager.m : 180 + 0xc] Found by: previous frame's frame pointer 3 libdispatch.dylib!_dispatch_call_block_and_release + 0x1c Found by: previous frame's frame pointer 4 libdispatch.dylib!_dispatch_client_callout + 0x10 Found by: previous frame's frame pointer 5 libdispatch.dylib!_dispatch_lane_serial_drain + 0x298 Found by: previous frame's frame pointer 6 libdispatch.dylib!_dispatch_lane_invoke + 0x17c Found by: previous frame's frame pointer 7 libdispatch.dylib!_dispatch_workloop_worker_thread + 0x284 Found by: previous frame's frame pointer 8 libsystem_pthread.dylib!_pthread_wqthread + 0x11c Found by: previous frame's frame pointer See attachment "iOS.crash" for the complete crash file. iOS.crash Ask what, do I need to use exclusive control when accessing BADownload? 2、Handling failed callbacks in background download extension, rearranging necessary resources crashed - (void)backgroundDownload:(BADownload *)download failedWithError:(NSError *)error { // Extension was woken because a download failed. // A download can be rescheduled with BADownloadManager if necessary. if (![download isKindOfClass:[BAURLDownload class]]) { return; } if (download.isEssential){ BADownload *nonEssential = [download copyAsNonEssential]; [BADownloadManager.sharedManager scheduleDownload:nonEssential error:nil]; } } Have a crash: hread 1 Crashed: 0 BackgroundAssets 0x0000000245b47dac -[BADownload setPriority:] + 176 (BADownload.m:249) 1 BackgroundAssets 0x0000000245b47bb4 -[BADownload copyWithZone:] + 188 (BADownload.m:217) 2 BackgroundAssets 0x0000000245b46db0 -[BAURLDownload copyWithZone:] + 52 (BAURLDownload.m:127) 3 BackgroundAssets 0x0000000245b47f7c -[BADownload copyAsNonEssential] + 20 (BADownload.m:368) 4 YYBackgroundDownload 0x0000000100de8a88 0x100de4000 + 19080 5 BackgroundAssets 0x0000000245b3fd50 __88-[BADownloaderExtensionConnection backgroundDownload:failedWithError:completionHandler:]_block_invoke + 56 (BADownloaderExtensionConnection.m:178) 6 libdispatch.dylib 0x00000001d8080320 _dispatch_call_block_and_release + 32 (init.c:1518) 7 libdispatch.dylib 0x00000001d8081eac _dispatch_client_callout + 20 (object.m:560) 8 libdispatch.dylib 0x00000001d8089534 _dispatch_lane_serial_drain + 668 (inline_internal.h:2640) 9 libdispatch.dylib 0x00000001d808a0a4 _dispatch_lane_invoke + 384 (queue.c:3966) 10 libdispatch.dylib 0x00000001d8094cdc _dispatch_workloop_worker_thread + 648 (queue.c:6913) 11 libsystem_pthread.dylib 0x0000000230547ddc _pthread_wqthread + 288 (pthread.c:2618) 12 libsystem_pthread.dylib 0x0000000230547b7c start_wqthread + 8 (:-1) Details see attachment 2023-09-19_09-46-22.4511_+0800-6c5f4b24bec7c04256c852d7a008978a886c15a3.crash
Replies
1
Boosts
0
Views
1.1k
Activity
Sep ’23
Background Assets have a crash: EXC_BREAKPOINT
I am starting the app and fetching the current downloading tasks through BADownloadManager.sharedManager.fetchCurrentDownloadsWithCompletionHandler. Then, I am reinitiating the tasks through startForegroundDownload. However, occasionally there is a crash with EXC_BREAKPOINT [BADownloadManager.sharedManager fetchCurrentDownloadsWithCompletionHandler:^(NSArray<BADownload *> * _Nonnull downloads, NSError * _Nullable error) { if (error){ return; } for (BADownload *download in downloads) { if ([urlList containsObject:download.identifier]){ if (download.state == BADownloadStateFailed) { return; } NSError *downloadError; BOOL succes = [BADownloadManager.sharedManager startForegroundDownload:download error:&downloadError]; if (downloadError) { LogError(BADownloadLog,@"startForegroundDownload url:%@ error:%@",download.identifier,downloadError); }else if(succes){ LogInfo(BADownloadLog,@"startForegroundDownload:%@",download.identifier); [self addDowdloadingUrl:download.identifier]; } } } }]; Crash stack: Crash reason: EXC_BREAKPOINT / EXC_ARM_BREAKPOINT Crash address: 0x21be8f638 Process uptime: 2 seconds Thread 3 (crashed) 0 BackgroundAssets!-[BADownloadManager startForegroundDownload:error:] + 0x100 Found by: given as instruction pointer in context 1 BackgroundAssets!-[BADownloadManager startForegroundDownload:error:] + 0xe0 Found by: previous frame's frame pointer 2 YYMobile!__46-[YYBADownloadManager executeDownload:finish:]_block_invoke [YYBADownloadManager.m : 180 + 0xc] Found by: previous frame's frame pointer 3 libdispatch.dylib!_dispatch_call_block_and_release + 0x1c Found by: previous frame's frame pointer 4 libdispatch.dylib!_dispatch_client_callout + 0x10 Found by: previous frame's frame pointer 5 libdispatch.dylib!_dispatch_lane_serial_drain + 0x298 Found by: previous frame's frame pointer 6 libdispatch.dylib!_dispatch_lane_invoke + 0x17c Found by: previous frame's frame pointer 7 libdispatch.dylib!_dispatch_workloop_worker_thread + 0x284 Found by: previous frame's frame pointer 8 libsystem_pthread.dylib!_pthread_wqthread + 0x11c Found by: previous frame's frame pointer The crash occurred at BOOL succes = [BADownloadManager.sharedManager startForegroundDownload:download error:&downloadError];
Replies
1
Boosts
0
Views
780
Activity
Sep ’23
The download failed, what are the requirements for the BackgroundDownloadExt certificate or BundleId?
xcrun backgroundassets-debug --simulate --app-install -d 00008120-0014188636D8C01E -b com.testBackGround.photos Application was installed event was sent for app identifier: (com.testBackGround.photos). WWDC Sessions Background Assets Extension container_create_or_lookup_app_group_path_by_app_group_identifier: client is not entitled backgroundassets.user Extension interrupted for identifier: com.testBackGround.photos runningboardd Invalidating assertion 31-413-2850 (target:[xpcservice<com.testBackGround.photos.BackgroundDownloadExt([osservice<com.apple.backgroundassets.user>:413])>:1479]) from originator [osservice<com.apple.backgroundassets.user>:413] backgroundassets.user Extension invalidated for identifier: com.testBackGround.photos backgroundassets.user Extension for app identifier com.testBackGround.photos ran for 1.1 seconds. backgroundassets.user Failed to send -[BADownloaderExtensionProxy requestDownloadsWithContentRequest:manifestURL:extensionInfo:completion:]_block_invoke for: com.testBackGround.photos error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.testBackGround.photos.BackgroundDownloadExt was invalidated from this process." UserInfo={NSDebugDescription=The connection to service named com.testBackGround.photos.BackgroundDownloadExt was invalidated from this process.} backgroundassets.user Removing manifest download as extension did not handle manifest. BAManifestDownload (0xc2d2075c0): [ID:com.testBackGround.photos.Manifest-466C2F4F-60C7-494A-85EA-5E59F243C176, AppID:com.testBackGround.photos, Necessity:Essential]
Replies
2
Boosts
0
Views
1.1k
Activity
Sep ’23
The extension of Background assets failed to run
xcrun backgroundassets-debug --simulate --app-install -d 00008120-0014188636D8C01E -b com.feitiandalong.photos Application was installed event was sent for app identifier: (com.feitiandalong.photos). It can be seen through charles capture that BAManifestURL has been successfully downloaded but none of the files in the manifest are downloaded. ACKs-compressed: 0, ACKs delayed: 0 delayed ACKs sent: 0 20:11:10.316138+0800 backgroundassets.user nw_flow_disconnected [C18 IPv4#98070097:443 cancelled parent-flow ((null))] Output protocol disconnected 20:11:10.317934+0800 backgroundassets.user nw_connection_report_state_with_handler_on_nw_queue [C18] reporting state cancelled 20:11:10.318057+0800 backgroundassets.user Connection 18: done 20:11:10.318375+0800 backgroundassets.user tcp_output [C18.1.1.1:3] flags=[FP.] seq=887285318, ack=2619599097, win=2048 state=FIN_WAIT_1 rcv_nxt=2619599097, snd_una=887285287 20:11:10.339591+0800 backgroundassets.user Removing manifest as extension processed the manifest. BAManifestDownload (0xcdca24b10): [ID:com.feitiandalong.photos.Manifest-576E82DE-A63B-4C9C-A463-266CAAEAA41D, AppID:com.feitiandalong.photos, Necessity:Essential] 20:11:10.340096+0800 backgroundassets.user Scheduled content request downloads count: 0 for client: com.feitiandalong.photos 20:11:10.341866+0800 backgroundassets.user user sessions enabled, targeting 501 20:11:10.345417+0800 backgroundassets.user cleaning up unpooled xpc conn to trustd 0xcdcc3a020 20:11:10.345523+0800 backgroundassets.user got event: Connection invalid 20:11:10.345550+0800 backgroundassets.user Trust evaluate failure: [leaf IssuerCommonName LeafMarkerOid SubjectCommonName] 20:11:10.357817+0800 backgroundassets.user user sessions enabled, targeting 501 20:11:10.360095+0800 backgroundassets.user cleaning up unpooled xpc conn to trustd 0xcdf20caa0 20:11:10.360199+0800 backgroundassets.user Trust evaluate failure: [leaf IssuerCommonName LeafMarkerOid SubjectCommonName] 20:11:10.360227+0800 backgroundassets.user got event: Connection invalid 20:11:10.366564+0800 backgroundassets.user was picked for validation 20:11:10.367495+0800 backgroundassets.user Client connection accepted from pid:620 20:11:10.708893+0800 backgroundassets.user tcp_input [C18.1.1.1:3] flags=[F.] seq=2619599097, ack=887285382, win=133 state=FIN_WAIT_2 rcv_nxt=2619599097, snd_una=887285382 20:11:25.379062+0800 backgroundassets.user Extension invalidated for identifier: com.feitiandalong.photos 20:11:25.379163+0800 backgroundassets.user Extension for app identifier com.feitiandalong.photos ran for 15.9 seconds. 20:11:25.379818+0800 runningboardd Invalidating assertion 31-432-2356 (target:[xpcservice<com.feitiandalong.photos.BackgroundDownloadExt([osservice<com.apple.backgroundassets.user>:432])>:620]) from originator [osservice<com.apple.backgroundassets.user>:432] 20:11:25.486812+0800 runningboardd Removed last relative-start-date-defining assertion for process xpcservice<com.feitiandalong.photos.BackgroundDownloadExt([osservice<com.apple.backgroundassets.user>:432])> 20:11:25.488538+0800 runningboardd Calculated state for xpcservice<com.feitiandalong.photos.BackgroundDownloadExt([osservice<com.apple.backgroundassets.user>:432])>: running-suspended (role: None) 20:11:25.488835+0800 runningboardd [xpcservice<com.feitiandalong.photos.BackgroundDownloadExt([osservice<com.apple.backgroundassets.user>:432])>:620] Set jetsam priority to 0 [0] flag[1] 20:11:25.489062+0800 runningboardd [xpcservice<com.feitiandalong.photos.BackgroundDownloadExt([osservice<com.apple.backgroundassets.user>:432])>:620] Suspending task. 20:11:25.489964+0800 runningboardd [xpcservice<com.feitiandalong.photos.BackgroundDownloadExt([osservice<com.apple.backgroundassets.user>:432])>:620] Shutdown sockets (SVC) 20:11:25.490145+0800 runningboardd [xpcservice<com.feitiandalong.photos.BackgroundDownloadExt([osservice<com.apple.backgroundassets.user>:432])>:620] Result 45 setting darwin role to None: Operation not supported, falling back to setting priority 20:11:25.490350+0800 runningboardd [xpcservice<com.feitiandalong.photos.BackgroundDownloadExt([osservice<com.apple.backgroundassets.user>:432])>:620] Set darwin priority to: PRIO_DARWIN_BG 20:11:25.490716+0800 runningboardd [xpcservice<com.feitiandalong.photos.BackgroundDownloadExt([osservice<com.apple.backgroundassets.user>:432])>:620] set Memory Limits to Hard Inactive (6) 20:11:25.491013+0800 runningboardd [xpcservice<com.feitiandalong.photos.BackgroundDownloadExt([osservice<com.apple.backgroundassets.user>:432])>:620] check if suspended process is holding locks 20:11:25.505215+0800 backgroundassets.user Received state update for 620
Replies
3
Boosts
0
Views
1k
Activity
Sep ’23
backgroundassets download failed
xcrun backgroundassets-debug --simulate --app-install -d 00008120-0014188636D8C01E -b com.linkone.photos Application was installed event was sent for app identifier: (com.linkone.photos). 1.Failed to get LSApplicationRecord for <RBSLaunchRequest| xpcservice<com.linkone.photos.BackgroundDownloadExt([osservice<com.apple.backgroundassets.user>:432])>; "Launching extension com.linkone.photos.BackgroundDownloadExt(417909C8-350A-40DB-BB09-011C6852A5F9) for host 432"> with error Error Domain=NSOSStatusErrorDomain Code=-10814 "(null)" UserInfo={_LSLine=1569, _LSFunction=runEvaluator} 2.Extension interrupted for identifier: com.linkone.photos 3.Failed to send -[BADownloaderExtensionProxy requestDownloadsWithContentRequest:manifestURL:extensionInfo:completion:]_block_invoke for: com.linkone.photos error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.linkone.photos.BackgroundDownloadExt was invalidated from this process." UserInfo={NSDebugDescription=The connection to service named com.linkone.photos.BackgroundDownloadExt was invalidated from this process.} 4.Removing manifest download as extension did not handle manifest. BAManifestDownload (0xcdcd199a0): [ID:com.linkone.photos.Manifest-A11C1BD7-4D46-4030-8AFB-3AC740645C5B, AppID:com.linkone.photos, Necessity:Essential] 5.Failed to lookup LSBundleRecord for audit token. Error Domain=NSOSStatusErrorDomain Code=-600 "The file system path for this process could not be determined. It may not be running, or it may have been deleted or moved while running." UserInfo={NSDebugDescription=The file system path for this process could not be determined. It may not be running, or it may have been deleted or moved while running., _LSLine=266, _LSFunction=+[LSBundleRecord _bundleRecordForAuditToken:checkNSBundleMainBundle:error:]} 6.RBSStateCapture remove item called for untracked item 31-432-3187 (target:[xpcservice<com.linkone.photos.BackgroundDownloadExt([osservice<com.apple.backgroundassets.user>:432])>:962])
Replies
2
Boosts
0
Views
1.1k
Activity
Sep ’23
File download failed
Failed to send -[BADownloaderExtensionProxy backgroundDownload:finishedWithSandboxToken:completionHandler:]_block_invoke for: com.xuhuiTest.photos error: Error Domain=NSCocoaErrorDomain Code=4097 "connection to service with pid 2085 named com.xuhuiTest.photos.BackgroundDownloadExt" UserInfo={NSDebugDescription=connection to service with pid 2085 named com.xuhuiTest.photos.BackgroundDownloadExt} Client is missing signing identifier, client must be signed with an identifier to use BackgroundAssets. (null) log.json
Replies
2
Boosts
0
Views
1k
Activity
Aug ’23
Where can I get source code in this video
If you can open source the code in this video, it will be a great help for learning this interface
Replies
0
Boosts
0
Views
685
Activity
Aug ’23
Background Assets: Questions about network status
Background asstes are triggered before the APP is launched. At this time, if the current device is not connected to the WIFI network, it will directly consume the operator's network traffic. Is there any way to limit this in order to avoid disputes over fees arising from the consumption of users' non-wifi traffic without their knowledge? For example, after extension is triggered, determine the network status when scheduling downloads?
Replies
0
Boosts
0
Views
793
Activity
Jul ’23
Background Assets: Not able to get access to withExclusiveControl
Sometimes not able to get access to withExclusiveControl I am not able to repro this, but once it can't get access, then killing the app also does not release the lock. I have to restart the device to get the control. Can we please fix this issue?
Replies
2
Boosts
0
Views
863
Activity
Jul ’23
Background Assets: Whether the size of BAEssentiaMaxInstallSize is included in BAMaxInstallSize?
The BAEssentiaMaxInstallSize key in the plist file indicates the installed maximum size of the necessary resources. Is this size the uncompression size, and is this size included in the size of the BAMaxInstallSize key? Is BAEssentialDownloadAllowance included in BADownloadAllowance?
Replies
2
Boosts
0
Views
946
Activity
Jul ’23
Background Assets:Failed to schedule download
I wrote the following code to schedule the download in extension: AURLDownload *essentialDownload = [[BAURLDownload alloc] initWithIdentifier:url request:[NSURLRequest requestWithURL:assetURL] essential:true fileSize:assetSize applicationGroupIdentifier:YYBASharedSettings.appGroupIdentifier priority:BADownloaderPriorityDefault]; NSLog(@"BackgroundAssetsTest extension Schedule essentialDownload url:%@",url); and the delegate callback is implemented as follows: - (void)backgroundDownload:(BADownload *)download failedWithError:(NSError *)error { NSLog(@"BackgroundAssetsTest extension failedWithError: %@",error); } The console outputs the following error: BackgroundAssetsTest extension failedWithError: Error Domain=BAErrorDomain Code=202 "The requested URL is not permitted to be downloaded until the application is launched." UserInfo={NSLocalizedFailureReason=The requested URL is not permitted to be downloaded until the application is launched.} What's the problem? Scheduled downloads can only be triggered by launching the APP?
Replies
1
Boosts
0
Views
899
Activity
Jul ’23
Background Assets Failed to move manifestURL to APP group
After receiving manifestURL in extension, I try to move it to the shared directory of APP group, as follows: NSURL *url = [NSFileManager.defaultManager containerURLForSecurityApplicationGroupIdentifier:self.appGroupIdentifier]; NSURL *storageURL = [url URLByAppendingPathComponent:@"YYBAResCache" isDirectory:YES]; BOOL isDirectory; BOOL isExists = [NSFileManager.defaultManager fileExistsAtPath:storageURL.path isDirectory:&isDirectory]; NSError *error = nil; if (!isExists || !isDirectory) { [NSFileManager.defaultManager createDirectoryAtURL:storageURL withIntermediateDirectories:YES attributes:@{NSFilePosixPermissions: [NSNumber numberWithShort:0777]} error:&error]; } if (error){ NSLog(@"Failed to create session storage directory:%@",error); } NSURL *localManifestURL = [sessionStorageURL URLByAppendingPathComponent:@"manifest.json"]; Next, move the file: NSError *error; [NSFileManager.defaultManager moveItemAtURL:manifestURL toURL:localManifestURL error:&error]; if (error) { NSLog(@"BackgroundAssetsTest extension saveMainifest:%@ to %@ error:%@",manifestURL,YYBASharedSettings.localManifestURL,error); } But I still received an error: BackgroundAssetsTest extension saveMainifest:file:///var/tmp/com.apple.backgroundassets.downloadstaging/com.devinprogress2021/2cf0ae65-3058-4522-80d5-f4d76747ad15.json to file:///private/var/mobile/Containers/Shared/AppGroup/F466C6BA-35D7-4115-8D8E-E1726E3D3696/YYBAResCache/manifest.json error:Error Domain=NSCocoaErrorDomain Code=513 "“2cf0ae65-3058-4522-80d5-f4d76747ad15.json” couldn’t be moved because you don’t have permission to access “YYBAResCache”." UserInfo={NSSourceFilePathErrorKey=/var/tmp/com.apple.backgroundassets.downloadstaging/com.yy.yymobile.devinprogress2021/2cf0ae65-3058-4522-80d5-f4d76747ad15.json, NSUserStringVariant=( Move ), NSDestinationFilePath=/private/var/mobile/Containers/Shared/AppGroup/F466C6BA-35D7-4115-8D8E-E1726E3D3696/YYBAResCache/manifest.json, NSFilePath=/var/tmp/com.apple.backgroundassets.downloadstaging/com.devinprogress2021/2cf0ae65-3058-4522-80d5-f4d76747ad15.json, NSUnderlyingError=0x14520d2d0 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}} why?
Replies
1
Boosts
0
Views
995
Activity
Jul ’23
Background Assets: Max Parallel downloads and Max Parallel Schedules allowed
In our app, We have to download 5000 assets in the Install/Periodic event. Obviously, we can't download them all in parallel. If we return all 5000 entries in the extension downloads function, will the system take care of queueing and downloading some 20 assets parallelly and take care of downloading all of 5000 assets? Or Should we return only 20 urls and after if got finished, from the finished call back we can repeatedly schedule the next 20 every time and can download all of 5000 assets? If we can't reduce the number of assets(like in our case 5000 entries), What is the recommended way of downloading it?
Replies
0
Boosts
0
Views
691
Activity
Jul ’23
Background Assets: BAURLDownload is finish, but the file cannot be read, the file does not exist
My Background Assets extension arranges to download image resources, as follows: NSURL *assetURL = [NSURL URLWithString:@"https://***.png”]; NSUInteger assetSize = 6849; switch (contentRequest) { case BAContentRequestInstall: case BAContentRequestUpdate: { BAURLDownload *essentialDownload = [[BAURLDownload alloc] initWithIdentifier:@"YYBADAsset" request:[NSURLRequest requestWithURL:assetURL] essential:true fileSize:assetSize applicationGroupIdentifier:appGroupIdentifier priority:BADownloaderPriorityDefault]; [downloadsToSchedule addObject:essentialDownload]; break; } } At the same time, the finishedWithFileURL method is implemented as follows: - (void)backgroundDownload:(BADownload *)download finishedWithFileURL:(NSURL *)fileURL { NSLog(@"BackgroundAssetsTest extension finishedWithFileURL:%@ forDownlad:%@",fileURL,download.identifier); NSLog(@"BackgroundAssetsTest extension finishedWithManifestURLExist:%@",@([[NSFileManager defaultManager] fileExistsAtPath:fileURL.absoluteString])); } And then use tools to trigger events, xcrun backgroundassets-debug --app-bundle-id com.luph.mytest --device-id 00008020-000A04xxF0002E --simulate --app-install The following log is observed through the console: BackgroundAssetsTest extension finishedWithFileURL:file:///private/var/mobile/Containers/Shared/AppGroup/1D051E06-E597-4670-969A-38ECA52C4F7A/Library/C aches/com.apple.BackgroundAssets/BAFile-5152AFB2.tmp forDownlad:YYBADAsset BackgroundAssetsTest extension finishedWithManifestURLExist:0 What's the problem? Did I set the size of BAURLDownload to be different from the actual download size? Or the wrong way to determine the existence of the file?
Replies
1
Boosts
0
Views
935
Activity
Jul ’23
Not able to download the file using Background Assets for TestFlight build
Hi, I used Background assets to download files during install/update events. The debug build works fine when I trigger the install event through terminal. The same code base (with different bundle ID ) is used in Test Flight build. But the file is not downloaded when I install the TestFlight build. I'm getting following error in Console while installing the TestFlight build. sometimes, i'm getting Failed to notify extension about finished download: BAURLDownload (0x61a80ab98): guard let url = URL(string:"https://devstreaming-cdn.apple.com/videos/wwdc/2021/10220/6/3866585A-3920-44B4-AB3F-03A446FCDE3A/downloads/wwdc2021-10220_hd.mp4") else{ return Set() } switch (request) { case .install, .update: let essentialDownload = BAURLDownload( identifier: "avtar345", request: URLRequest(url: url), essential: true, fileSize: 155384552, applicationGroupIdentifier: appGroupIdentifier, priority: .default) downloadsToSchedule.insert(essentialDownload) break; case .periodic: break; }
Replies
1
Boosts
0
Views
757
Activity
Jul ’23
Failed to notify extension about finished download: BAURLDownload
Hi team, I tried to download an image using the background assets . In development it downloads the image when I trigger the xcrun backgroundassets-debug command with instal event. But the image is not downloading for Test flight build. In console I observed the following errors while installing the app, Why am I getting this error while installing the app and how to resolve this?
Replies
0
Boosts
0
Views
708
Activity
Jul ’23
The requested URL is not permitted to be downloaded until the application is launched error in background assets
Hi , i tried to download image using background assets framework. I tried to use install and update events to test the extension. But the extension always delegate to backgroundDownload(_ :failedWithError :) function with following error Error Domain=BAErrorDomain Code=202 "The requested URL is not permitted to be downloaded until the application is launched." UserInfo={NSLocalizedFailureReason=The requested URL is not permitted to be downloaded until the application is launched.} I used the following url to download the image https://w0.peakpx.com/wallpaper/934/165/HD-wallpaper-avatar-aang-aang-airbender-aire-appa-avatar-legend-leyenda.jpg Why am i getting this error and how to resolve this?
Replies
3
Boosts
0
Views
1.2k
Activity
Jun ’23