Skip to content

BackgroundAssets tvOS xcode16.3 b1

Rolf Bjarne Kvinge edited this page Feb 24, 2025 · 1 revision

#BackgroundAssets.framework

diff -ruN /Applications/Xcode_16.2.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAAppExtensionInfo.h /Applications/Xcode_16.3.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAAppExtensionInfo.h
--- /Applications/Xcode_16.2.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAAppExtensionInfo.h	1970-01-01 01:00:00
+++ /Applications/Xcode_16.3.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAAppExtensionInfo.h	2025-02-07 19:31:51
@@ -0,0 +1,42 @@
+//
+//  BAAppExtensionInfo.h
+//  BackgroundAssets
+//
+//  Copyright (c) 2022, Apple Inc.
+//  All rights reserved.
+//
+
+#import <BackgroundAssets/BackgroundAssets.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+API_AVAILABLE(macos(13.0), ios(16.1), visionos(2.4), tvos(18.4)) API_UNAVAILABLE(watchos)
+NS_SWIFT_SENDABLE
+@interface BAAppExtensionInfo : NSObject <NSSecureCoding>
+
+/// @brief The number of bytes remaining that can be scheduled if the total download size is restricted.
+/// @discussion When a download is restricted, your extension can only schedule up to its `BADownloadAllowance`
+/// defined in your app's `Info.plist`. This result tells you the number of bytes remaining that can be scheduled
+/// before the application is launched. Once the application is launched, this restriction is removed.
+/// @result The result is `nil` if downloads are not restricted. It returns a valid number with the remaining available download size otherwise.
+@property (readonly, strong, nullable) NSNumber *restrictedDownloadSizeRemaining
+NS_REFINED_FOR_SWIFT;
+
+/// @brief The number of bytes remaining that can be scheduled if the total download size of optional assets is restricted.
+/// @discussion When a download is restricted, your extension can only schedule up to its `BAEssentialDownloadAllowance`
+/// defined in your app's `Info.plist`. This result tells you the number of bytes remaining that can be scheduled
+/// before the application is launched. Once the application is launched, this restriction is removed.
+/// @result The result is `nil` if downloads are not restricted. It returns a valid number with the remaining available download size otherwise.
+@property (readonly, strong, nullable) NSNumber *restrictedEssentialDownloadSizeRemaining
+API_AVAILABLE(macos(13.3), ios(16.4), visionos(2.4), tvos(18.4)) API_UNAVAILABLE(watchos)
+NS_REFINED_FOR_SWIFT;
+
+- (instancetype)init
+NS_UNAVAILABLE;
+
++ (instancetype)new
+NS_UNAVAILABLE;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_16.2.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BABase.h /Applications/Xcode_16.3.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BABase.h
--- /Applications/Xcode_16.2.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BABase.h	1970-01-01 01:00:00
+++ /Applications/Xcode_16.3.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BABase.h	2025-02-07 19:31:50
@@ -0,0 +1,35 @@
+//
+//  BABase.h
+//  BackgroundAssets
+//
+//  Copyright (c) 2022, Apple Inc.
+//  All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+#ifndef BA_EXPORT
+    #ifdef __cplusplus
+        #define BA_EXPORT   extern "C" __attribute__((visibility ("default")))
+    #else
+        #define BA_EXPORT   extern __attribute__((visibility ("default")))
+    #endif
+#endif
+#ifndef BA_HIDDEN
+    #ifdef __cplusplus
+        #define BA_HIDDEN   "C" __attribute__((visibility("hidden")))
+    #else
+        #define BA_HIDDEN   __attribute__((visibility("hidden")))
+    #endif
+#endif
+#ifndef BA_HIDDEN_EXTERN
+    #ifdef __cplusplus
+        #define BA_HIDDEN_EXTERN  extern "C" __attribute__((visibility("hidden")))
+    #else
+        #define BA_HIDDEN_EXTERN  extern __attribute__((visibility("hidden")))
+    #endif
+#endif
+
+NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_16.2.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BADownload.h /Applications/Xcode_16.3.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BADownload.h
--- /Applications/Xcode_16.2.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BADownload.h	1970-01-01 01:00:00
+++ /Applications/Xcode_16.3.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BADownload.h	2025-02-07 19:31:51
@@ -0,0 +1,86 @@
+//
+//  BADownload.h
+//  BackgroundAssets
+//
+//  Copyright (c) 2022, Apple Inc.
+//  All rights reserved.
+//
+
+#import <BackgroundAssets/BackgroundAssets.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+/// @typedef Download state
+typedef NS_ENUM(NSInteger, BADownloadState) {
+    BADownloadStateFailed = -1,
+    BADownloadStateCreated = 0,
+    BADownloadStateWaiting,
+    BADownloadStateDownloading,
+    BADownloadStateFinished,
+}
+NS_SWIFT_NAME(BADownload.State);
+
+/// @brief A download's priority
+/// @discussion The priority applied to a given download or group of downloads. This is a range from `BADownloaderPriorityMin` to `BADownloaderPriorityMax`.
+/// The priority only applies to how downloads are ordered for your application. Higher priority items will be enqued for download before lower priority items regardless of order in which they are scheduled.
+typedef NSInteger BADownloaderPriority NS_TYPED_EXTENSIBLE_ENUM
+NS_SWIFT_NAME(BADownload.Priority);
+
+/// @brief A value that represents the lowest priority for a download.
+FOUNDATION_EXPORT const BADownloaderPriority BADownloaderPriorityMin
+API_AVAILABLE(macos(13.0), ios(16.1), visionos(2.4), tvos(18.4)) API_UNAVAILABLE(watchos);
+
+/// @brief A value that represents average priority for a download.
+FOUNDATION_EXPORT const BADownloaderPriority BADownloaderPriorityDefault
+API_AVAILABLE(macos(13.0), ios(16.1), visionos(2.4), tvos(18.4)) API_UNAVAILABLE(watchos);
+
+/// @brief A value that represents the highest priority for a download.
+FOUNDATION_EXPORT const BADownloaderPriority BADownloaderPriorityMax
+API_AVAILABLE(macos(13.0), ios(16.1), visionos(2.4), tvos(18.4)) API_UNAVAILABLE(watchos);
+
+NS_SWIFT_SENDABLE
+API_AVAILABLE(macos(13.0), ios(16.1), visionos(2.4), tvos(18.4)) API_UNAVAILABLE(watchos)
+@interface BADownload : NSObject<NSCoding, NSSecureCoding, NSCopying>
+
+/// @brief The current state of the respresented download.
+@property (readonly, nonatomic) BADownloadState state
+API_AVAILABLE(macos(13.0), ios(16.1), visionos(2.4), tvos(18.4)) API_UNAVAILABLE(watchos);
+
+/// @brief A client defined identifier that uniquely identifies this asset.
+@property (readonly, nonatomic) NSString *identifier
+API_AVAILABLE(macos(13.0), ios(16.1), visionos(2.4), tvos(18.4)) API_UNAVAILABLE(watchos);
+
+/// @brief A UUID that uniquely identifies the download object.
+@property (readonly, nonatomic) NSString *uniqueIdentifier
+API_AVAILABLE(macos(13.0), ios(16.1), visionos(2.4), tvos(18.4)) API_UNAVAILABLE(watchos);
+
+/// @brief A client set priority to try to order downloads in order of importance
+@property (readonly) BADownloaderPriority priority
+API_AVAILABLE(macos(13.0), ios(16.1), visionos(2.4), tvos(18.4)) API_UNAVAILABLE(watchos);
+
+/// @brief Whether this download is essential.
+/// Essential downloads will occur while the app is being installed. Users cannot launch the app while these downloads are occurring.
+/// Essential downloads cannot be scheduled with `BADownloadManager`, they may only be scheduled from the extension with
+/// a `BAContentRequest` type of `Update` or `Install`.
+/// Essential downloads must have an accurate `fileSize` or they will fail.
+@property (readonly) BOOL isEssential
+API_AVAILABLE(macos(13.3), ios(16.4), visionos(2.4), tvos(18.4)) API_UNAVAILABLE(watchos);
+
+/// @brief Copies an existing download ensuring that it has `isEssential == false`.
+/// @discussion This serves as a convenience method for constructing a non-essential representation of an existing
+/// download. It is important to note that essential downloads can only be enqueued by
+/// the app extension during a content request. If an essential download fails, `copyAsNonEssential`
+/// can be used to create a copy with `isEssential == false` that can be re-queued with `BADownloadManager`.
+- (instancetype)copyAsNonEssential
+API_AVAILABLE(macos(13.3), ios(16.4), visionos(2.4), tvos(18.4)) API_UNAVAILABLE(watchos)
+NS_SWIFT_NAME(removingEssential());
+
+- (instancetype)init
+NS_UNAVAILABLE;
+
++ (instancetype)new
+NS_UNAVAILABLE;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_16.2.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BADownloadManager.h /Applications/Xcode_16.3.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BADownloadManager.h
--- /Applications/Xcode_16.2.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BADownloadManager.h	1970-01-01 01:00:00
+++ /Applications/Xcode_16.3.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BADownloadManager.h	2025-02-07 22:41:23
@@ -0,0 +1,132 @@
+//
+//  BADownloader.h
+//  BackgroundAssets
+//
+//  Copyright (c) 2022, Apple Inc.
+//  All rights reserved.
+//
+
+#import <BackgroundAssets/BackgroundAssets.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+API_AVAILABLE(macos(13.0), ios(16.1), visionos(2.4), tvos(18.4)) API_UNAVAILABLE(watchos)
+@protocol BADownloadManagerDelegate <NSObject>
+
+@optional
+
+/// @brief A download has started.
+- (void)downloadDidBegin:(BADownload *)download;
+
+/// @brief A download has paused.
+- (void)downloadDidPause:(BADownload *)download;
+
+/// @brief A download has made progress in bytes / total so far / total expected.
+- (void)download:(BADownload *)download didWriteBytes:(int64_t)bytesWritten
+                                    totalBytesWritten:(int64_t)totalBytesWritten
+                            totalBytesExpectedToWrite:(int64_t)totalExpectedBytes;
+
+/// @brief A download has tried to start but gotten a challenge quest.
+- (void)download:(BADownload *)download didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge
+                                          completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential * _Nullable credential))completionHandler;
+
+/// @brief A download has failed with a specific error.
+- (void)download:(BADownload *)download failedWithError:(NSError *)error;
+
+/// @brief Download has finished.
+/// @param fileURL A location to the file that has been downloaded.
+/// @discussion The file located at `fileURL` must be moved before this method exits scope, or it will be deleted.
+/// It is strongly advised to move the file to its permanent destination rather than copy it.
+/// @warning The file is marked by the system for deletion when the device becomes low on storage. Avoid copying or modifying
+/// the file, as this may remove the system's ability to delete the file.
+- (void)download:(BADownload *)download finishedWithFileURL:(NSURL *)fileURL;
+
+@end
+
+API_AVAILABLE(macos(13.0), ios(16.1), visionos(2.4), tvos(18.4)) API_UNAVAILABLE(watchos)
+@interface BADownloadManager : NSObject
+
+- (instancetype)init
+NS_UNAVAILABLE;
++ (instancetype)new
+NS_UNAVAILABLE;
+
+/// @brief Gets the singleton downloader object.
+@property (class, readonly, strong) BADownloadManager *sharedManager
+API_AVAILABLE(macos(13.0), ios(16.1), visionos(2.4), tvos(18.4)) API_UNAVAILABLE(watchos)
+NS_SWIFT_NAME(shared);
+
+/// @brief A object confroming to BADownloadManagerDelegate to get notified when actions occur.
+@property (weak) id<BADownloadManagerDelegate> delegate
+API_AVAILABLE(macos(13.0), ios(16.1), visionos(2.4), tvos(18.4)) API_UNAVAILABLE(watchos);
+
+/// @brief Fetches current downloads.
+/// @discussion Fetches the current list of scheduled or in-flight downloads queued by your application or extension.
+/// @param error An error representing why the downloads could not be fetched.
+/// @return On success, returns a list of scheduled or in-flight downloads. On failure, returns nil and sets @c error.
+/// @warning This method can block and should not be called from the main thread.
+/// @seealso BADownloadManager:fetchCurrentDownloadsWithCompletionHandler
+- (nullable NSArray<BADownload *> *)fetchCurrentDownloads:(NSError* _Nullable __autoreleasing *)error
+API_AVAILABLE(macos(13.3), ios(16.4), visionos(2.4), tvos(18.4)) API_UNAVAILABLE(watchos);
+
+/// @brief Fetches current downloads.
+/// @discussion Fetches the current list of scheduled or in-flight downloads queued by your application or extension.
+/// @param completionHandler A block to recieve the currently scheduled or in-flight downloads. The block is called on the same queue as all the other completion blocks in the class.
+- (void)fetchCurrentDownloadsWithCompletionHandler:(void(^ NS_SWIFT_SENDABLE)(NSArray<BADownload *> *downloads, NSError *_Nullable error))completionHandler
+API_AVAILABLE(macos(13.0), ios(16.1), visionos(2.4), tvos(18.4)) API_UNAVAILABLE(watchos)
+NS_SWIFT_NAME(fetchCurrentDownloads(completionHandler:))
+NS_SWIFT_ASYNC_NAME(getter:currentDownloads());
+
+/// @brief Schedules a background download.
+/// @discussion Specifies a download to schedule at a given priority. The download will automatically
+/// start at the discretion of the system.
+/// @param download A BADownload object representing a URL to be downloaded.
+/// @param error A NSError representing why the BADownload could not be scheduled.
+/// @return YES if @c download was scheduled. NO and @c error set if the download could not be scheduled.
+- (BOOL)scheduleDownload:(BADownload *)download
+                   error:(NSError* _Nullable __autoreleasing *)error
+API_AVAILABLE(macos(13.0), ios(16.1), visionos(2.4), tvos(18.4)) API_UNAVAILABLE(watchos);
+
+/// @brief Acquires exclusive access to the BADownloadManager across the app and application extension.
+/// @discussion Acquires exclusive access to the BADownloadManager across the app and application extension. This ensures that your extension and app
+/// do not perform operations at the same time. Both the extension and app must use this API to ensure exclusive access.
+/// @param performHandler A block that will be executed once exclusive control is acquired.
+/// If an error is non-nil then a problem occurred acquiring exclusive access.
+- (void)performWithExclusiveControl:(void (^ NS_SWIFT_SENDABLE)(BOOL acquiredLock, NSError *_Nullable error))performHandler
+API_AVAILABLE(macos(13.0), ios(16.1), visionos(2.4), tvos(18.4)) API_UNAVAILABLE(watchos)
+NS_SWIFT_NAME(withExclusiveControl(_:))
+NS_SWIFT_DISABLE_ASYNC;
+
+/// @brief Acquires exclusive access to the BADownloadManager across the app and application extension.
+/// @discussion Acquires exclusive access to the BADownloadManager across the app and application extension. This ensures that your extension and app
+/// do not perform operations at the same time. Both the extension and app must use this API to ensure exclusive access.
+/// @param date A date by which you want exclusive control acquired. If you pass +[NSDate date], control will attempt to be acquired and if it can not be, it will fail instantly.
+/// @param performHandler A block that will be executed once exclusive control is acquired.
+/// If an error is non-nil then a problem occurred acquiring exclusive access.
+- (void)performWithExclusiveControlBeforeDate:(NSDate *)date
+                               performHandler:(void (^ NS_SWIFT_SENDABLE)(BOOL acquiredLock, NSError *_Nullable error))performHandler
+API_AVAILABLE(macos(13.0), ios(16.1), visionos(2.4), tvos(18.4)) API_UNAVAILABLE(watchos)
+NS_SWIFT_NAME(withExclusiveControl(beforeDate:perform:))
+NS_SWIFT_DISABLE_ASYNC;
+
+/// @brief Attempts to schedule a BADownload in foreground mode.
+/// @discussion Attempts to schedule a BADownload in foreground mode. This download will start (if it has not been started) immediately regrardlesss of battery or
+/// network status. The download will remain in this foreground until the download manager is disconnected. This API only functions if the download manager is created in
+/// the application and not the download extension. If this API is called from the download extension, NO will be returned along with a NSError with the settings
+/// BAErrorDomain : BAErrorCodeCallFromExtensionNotAllowed. If this API is called from a app while it is in the background, NO will be returned along with a NSError
+/// with the settings BAErrorDomain : BAErrorCodeCallFromInactiveProcessNotAllowed.
+- (BOOL)startForegroundDownload:(BADownload *)download
+                          error:(NSError* _Nullable __autoreleasing *)error
+API_AVAILABLE(macos(13.0), ios(16.1), visionos(2.4), tvos(18.4)) API_UNAVAILABLE(watchos);
+
+/// @brief Cancels a download.
+/// @discussion Attempts to cancel a BADownload. If the download has not been schduled or has already completed, NO is returned along with a NSError set
+/// to BAErrorDomain : BAErrorCodeDownloadNotScheduled.
+/// @return YES if the download is canceled. NO if the download could not be canceled, @c error will be set with a reason why.
+- (BOOL)cancelDownload:(BADownload *)download
+                 error:(NSError **)error
+API_AVAILABLE(macos(13.0), ios(16.1), visionos(2.4), tvos(18.4)) API_UNAVAILABLE(watchos);
+
+@end
+
+NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_16.2.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BADownloaderExtension.h /Applications/Xcode_16.3.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BADownloaderExtension.h
--- /Applications/Xcode_16.2.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BADownloaderExtension.h	1970-01-01 01:00:00
+++ /Applications/Xcode_16.3.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BADownloaderExtension.h	2025-02-07 22:41:23
@@ -0,0 +1,72 @@
+//
+//  BADownloaderExtension.h
+//  BackgroundAssets
+//
+//  Copyright (c) 2022, Apple Inc.
+//  All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import <BackgroundAssets/BackgroundAssets.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+API_AVAILABLE(macos(13.0), ios(16.1), visionos(2.4), tvos(18.4)) API_UNAVAILABLE(watchos)
+NS_REFINED_FOR_SWIFT
+@protocol BADownloaderExtension <NSObject>
+
+@optional
+
+/*!
+ @abstract Invoked by the system when the extension should check for updated content.
+ @discussion This method will be invoked by the system upon requested events defined in `BAContentRequest`.
+ This method should return a set of all `BAURLDownload`'s that your extension would like to schedule.
+ During the invocation of this method, `BADownloadManager` will prohibit the ability to schedule additional downloads
+ until this method exits scope. Therefore, all downloads needing to be scheduled should be returned here.
+ If a download fails, it can be rescheduled using `BADownloadManager` in any other method in this protocol.
+ @param contentRequest The content request event that occured that caused this method to be invoked.
+ @param manifestURL A file URL to the local manifest that was pre-downloaded and specified in your App's Info.plist under the `BAManifestURL`.
+ The file is read-only and will be deleted after this method returns. If you wish to keep it, you must copy it out.
+ @param extensionInfo Information about your extension that may be useful for making a decision about
+ what content needs to be scheduled.
+ @result A set of unique `BAURLDownload` objects that the extension should schedule for download.
+ @warning You cannot use `BADownloadManager` to manually schedule downloads using this method. All downloads to enqueue must be returned.
+ */
+- (NSSet<BADownload *> *)downloadsForRequest:(BAContentRequest)contentRequest
+                                 manifestURL:(NSURL *)manifestURL
+                               extensionInfo:(BAAppExtensionInfo *)extensionInfo;
+
+/// @brief Download is about to begin but requires an authentication challenge to continue.
+- (void)backgroundDownload:(BADownload *)download
+       didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge
+         completionHandler:(void (^ NS_SWIFT_SENDABLE)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential * _Nullable credential))completionHandler;
+
+/// @abstract This method is called when a download has failed but there is no `BADownloadManager` delegate to handle the completion event.
+/// @discussion When a download has failed, this method will be invoked.
+/// If a download fails you may reschedule it with `BADownloadManager`.
+/// @param download The download object that has failed.
+/// @param error The error that caused the failure.
+- (void)backgroundDownload:(BADownload *)download failedWithError:(NSError *)error;
+
+/// @abstract This method is called when a download has finished but there is no `BADownloadManager` delegate to handle the completion event.
+/// @param download Download that has completed successfully.
+/// @param fileURL A location to the file that has been downloaded.
+/// @discussion When a download succeeds, this method will be invoked; however it is only invoked if there is no other client using `BADownloadManager`
+/// with a hooked in `delegate`. The file located at `fileURL` must be moved before this method exits scope, or it will be deleted.
+/// It is strongly advised to move the file to its permanent destination rather than copy it.
+/// @warning The file is marked by the system for deletion when the device becomes low on storage. Avoid copying or modifying
+/// the file, as this may remove the system's ability to delete the file.
+- (void)backgroundDownload:(BADownload *)download finishedWithFileURL:(NSURL *)fileURL;
+
+/// @brief This method may be called shortly before the extension is terminated.
+/// @discussion This method is invoked if all extension callbacks have returned or if the extension has run over it's alotted runtime.
+/// This callback provides a last chance to tidy up state before process termination.
+/// @warning This method is advisory only, there will be instances where the extension is terminated before this method is invoked.
+/// Do not rely on this method being invoked before the extension is terminated.
+- (void)extensionWillTerminate
+API_DEPRECATED("extensionWillTerminate will not be invoked in all applicable circumstances and should not be relied upon.", ios(16.1, 16.4), macos(13.0, 13.3))
+API_UNAVAILABLE(tvos, watchos, visionos);
+
+@end
+
+NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_16.2.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAError.h /Applications/Xcode_16.3.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAError.h
--- /Applications/Xcode_16.2.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAError.h	1970-01-01 01:00:00
+++ /Applications/Xcode_16.3.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAError.h	2025-02-07 19:31:51
@@ -0,0 +1,67 @@
+//
+//  BAError.h
+//  BackgroundAssets
+//
+//  Copyright (c) 2022, Apple Inc.
+//  All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import <BackgroundAssets/BackgroundAssets.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+__BEGIN_DECLS
+
+#pragma mark -
+#pragma mark BAErrorDomain
+
+
+/// @brief The error domain used for Background Assets errors.
+BA_EXPORT
+NSString * const BAErrorDomain
+API_AVAILABLE(macos(14.0), ios(17.0), visionos(2.4), tvos(18.4)) API_UNAVAILABLE(watchos);
+
+/// @typedef Background Assets error codes.
+/// @constant BAErrorCodeDownloadInvalid Invalid error code.
+/// @constant BAErrorCodeCallFromExtensionNotAllowed Calling this method from the download extension is not allowed.
+/// @constant BAErrorCodeCallFromInactiveProcessNotAllowed Calling this method from an inactive process is not allowed.
+/// @constant BAErrorCodeCallerConnectionNotAccepted This operation cannot be performed because the caller is not accepted based on its application or extension identifier.
+/// @constant BAErrorCodeCallerConnectionInvalid This operation cannot be performed because the connection to the background asset system service is invalid.
+/// @constant BAErrorCodeDownloadAlreadyScheduled A download with the requested identifier has already been scheduled.
+/// @constant BAErrorCodeDownloadNotScheduled The requested download is not scheduled.
+/// @constant BAErrorCodeDownloadFailedToStart The requested download failed to start.
+/// @constant BAErrorCodeDownloadAlreadyFailed The requested download has failed.
+/// @constant BAErrorCodeDownloadEssentialDownloadNotPermitted The requested download could not be enqueued because the download is marked as essential, which is prohibited in this context.
+/// @constant BAErrorCodeDownloadBackgroundActivityProhibited The requested download could not be enqueued. Check the device‘s Low Power Mode or Background App Refresh settings.
+/// @constant BAErrorCodeDownloadWouldExceedAllowance The requested download cannot be enqueued. The download would exceed the download allowance.
+/// @constant BAErrorCodeSessionDownloadDisallowedByDomain The requested URL is not permitted to be downloaded until the application is launched.
+/// @constant BAErrorCodeSessionDownloadDisallowedByAllowance The requested download will not be allowed due to running out of download allowance.
+/// @constant BAErrorCodeSessionDownloadAllowanceExceeded The requested download failed because the download allowance has been exceeded.
+/// @constant BAErrorCodeSessionDownloadNotPermittedBeforeAppLaunch The requested download cannot be scheduled before the app has been launched.
+typedef NS_ENUM(NSInteger, BAErrorCode) {
+    BAErrorCodeDownloadInvalid = 0,
+
+    BAErrorCodeCallFromExtensionNotAllowed = 50,
+    BAErrorCodeCallFromInactiveProcessNotAllowed = 51,
+    BAErrorCodeCallerConnectionNotAccepted = 55,
+    BAErrorCodeCallerConnectionInvalid = 56,
+
+    BAErrorCodeDownloadAlreadyScheduled = 100,
+    BAErrorCodeDownloadNotScheduled = 101,
+    BAErrorCodeDownloadFailedToStart = 102,
+    BAErrorCodeDownloadAlreadyFailed = 103,
+    BAErrorCodeDownloadEssentialDownloadNotPermitted = 109,
+    BAErrorCodeDownloadBackgroundActivityProhibited = 111,
+    BAErrorCodeDownloadWouldExceedAllowance = 112,
+
+    BAErrorCodeSessionDownloadDisallowedByDomain = 202,
+    BAErrorCodeSessionDownloadDisallowedByAllowance = 203,
+    BAErrorCodeSessionDownloadAllowanceExceeded = 204,
+    BAErrorCodeSessionDownloadNotPermittedBeforeAppLaunch = 206,
+}
+API_AVAILABLE(macos(14.0), ios(17.0), visionos(2.4), tvos(18.4)) API_UNAVAILABLE(watchos);
+
+__END_DECLS
+
+NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_16.2.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BATypes.h /Applications/Xcode_16.3.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BATypes.h
--- /Applications/Xcode_16.2.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BATypes.h	1970-01-01 01:00:00
+++ /Applications/Xcode_16.3.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BATypes.h	2025-02-07 19:31:50
@@ -0,0 +1,24 @@
+//
+//  BATypes.h
+//  BackgroundAssets
+//
+//  Copyright (c) 2022, Apple Inc.
+//  All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import <BackgroundAssets/BackgroundAssets.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+/// @abstract The content request type used in the BADownloaderExtension.
+/// @constant BAContentRequestInstall  Content is being requested because the application was installed.
+/// @constant BAContentRequestUpdate Content is being requested because the application was updated.
+/// @constant BAContentRequestPeriodic Content is being requested because the system is asking for updated content for your application.
+typedef NS_ENUM(NSInteger, BAContentRequest) {
+    BAContentRequestInstall = 1,
+    BAContentRequestUpdate,
+    BAContentRequestPeriodic,
+};
+
+NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_16.2.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAURLDownload.h /Applications/Xcode_16.3.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAURLDownload.h
--- /Applications/Xcode_16.2.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAURLDownload.h	1970-01-01 01:00:00
+++ /Applications/Xcode_16.3.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAURLDownload.h	2025-02-07 19:31:50
@@ -0,0 +1,78 @@
+//
+//  BAURLDownload.h
+//  BackgroundAssets
+//
+//  Copyright (c) 2022, Apple Inc.
+//  All rights reserved.
+//
+
+#import <BackgroundAssets/BackgroundAssets.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+NS_SWIFT_SENDABLE
+API_AVAILABLE(macos(13.0), ios(16.1), visionos(2.4), tvos(18.4)) API_UNAVAILABLE(watchos)
+@interface BAURLDownload : BADownload<NSCopying>
+
++ (instancetype)new NS_UNAVAILABLE;
+- (instancetype)init NS_UNAVAILABLE;
+
+/// @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 fileSize The size of the file to download. 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.
+/// @param applicationGroupIdentifier The identifier of the application group that should used to store the finished download.
+- (instancetype)initWithIdentifier:(NSString *)identifier
+                           request:(NSURLRequest *)request
+                          fileSize:(NSUInteger)fileSize
+        applicationGroupIdentifier:(NSString *)applicationGroupIdentifier
+API_AVAILABLE(macos(13.3), ios(16.4), visionos(2.4), tvos(18.4)) API_UNAVAILABLE(watchos);
+
+/// @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. 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.
+/// @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.
+- (instancetype)initWithIdentifier:(NSString *)identifier
+                           request:(NSURLRequest *)request
+                         essential:(BOOL)essential
+                          fileSize:(NSUInteger)fileSize
+        applicationGroupIdentifier:(NSString *)applicationGroupIdentifier
+                          priority:(BADownloaderPriority)priority
+NS_DESIGNATED_INITIALIZER
+API_AVAILABLE(macos(13.3), ios(16.4), visionos(2.4), tvos(18.4)) API_UNAVAILABLE(watchos);
+
+#pragma mark -
+#pragma mark Deprecated APIs
+
+/// @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 applicationGroupIdentifier The identifier of the application group that should used to store the finished download.
+- (instancetype)initWithIdentifier:(NSString *)identifier
+                           request:(NSURLRequest *)request
+        applicationGroupIdentifier:(NSString *)applicationGroupIdentifier
+API_DEPRECATED_WITH_REPLACEMENT("initWithIdentifier:request:fileSize:applicationGroupIdentifier:", ios(16.1, 16.4), macos(13.0, 13.3))
+API_UNAVAILABLE(tvos, watchos, visionos);
+
+/// @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 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.
+- (instancetype)initWithIdentifier:(NSString *)identifier
+                           request:(NSURLRequest *)request
+        applicationGroupIdentifier:(NSString *)applicationGroupIdentifier
+                          priority:(BADownloaderPriority)priority
+API_DEPRECATED_WITH_REPLACEMENT("initWithIdentifier:request:essential:fileSize:applicationGroupIdentifier:priority:", ios(16.1, 16.4), macos(13.0, 13.3))
+API_UNAVAILABLE(tvos, watchos, visionos);
+
+@end
+
+NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_16.2.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BackgroundAssets.apinotes /Applications/Xcode_16.3.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BackgroundAssets.apinotes
--- /Applications/Xcode_16.2.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BackgroundAssets.apinotes	1970-01-01 01:00:00
+++ /Applications/Xcode_16.3.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BackgroundAssets.apinotes	2025-02-07 19:25:55
@@ -0,0 +1,2 @@
+---
+Name: BackgroundAssets
diff -ruN /Applications/Xcode_16.2.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BackgroundAssets.h /Applications/Xcode_16.3.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BackgroundAssets.h
--- /Applications/Xcode_16.2.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BackgroundAssets.h	1970-01-01 01:00:00
+++ /Applications/Xcode_16.3.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BackgroundAssets.h	2025-02-07 19:31:50
@@ -0,0 +1,18 @@
+//
+//  BackgroundAssets.h
+//  BackgroundAssets
+//
+// Copyright (c) 2022, Apple Inc.
+// All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+#import <BackgroundAssets/BABase.h>
+#import <BackgroundAssets/BATypes.h>
+#import <BackgroundAssets/BADownload.h>
+#import <BackgroundAssets/BAAppExtensionInfo.h>
+#import <BackgroundAssets/BADownloaderExtension.h>
+#import <BackgroundAssets/BADownloadManager.h>
+#import <BackgroundAssets/BAURLDownload.h>
+#import <BackgroundAssets/BAError.h>
Clone this wiki locally