Skip to content

BackgroundAssets iOS xcode14.3 beta1

Alex Soto edited this page Mar 15, 2023 · 2 revisions

#BackgroundAssets.framework https://github.com/xamarin/xamarin-macios/pull/17810

diff -ruN /Applications/Xcode_14.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAAppExtensionInfo.h /Applications/Xcode_14.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAAppExtensionInfo.h
--- /Applications/Xcode_14.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAAppExtensionInfo.h	2022-11-10 19:18:32
+++ /Applications/Xcode_14.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAAppExtensionInfo.h	2023-02-12 14:13:57
@@ -10,16 +10,25 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
-API_AVAILABLE(macos(13.0), macCatalyst(16.0), ios(16.1)) API_UNAVAILABLE(tvos, watchos)
+API_AVAILABLE(macos(13.0), ios(16.1)) API_UNAVAILABLE(tvos, 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 `BAInitialDownloadAllowance`
+/// @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)) API_UNAVAILABLE(tvos, watchos)
 NS_REFINED_FOR_SWIFT;
 
 - (instancetype)init
diff -ruN /Applications/Xcode_14.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BABase.h /Applications/Xcode_14.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BABase.h
--- /Applications/Xcode_14.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BABase.h	2022-11-05 07:29:48
+++ /Applications/Xcode_14.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BABase.h	2023-02-10 13:52:42
@@ -24,5 +24,12 @@
         #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_14.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BADownload.h /Applications/Xcode_14.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BADownload.h
--- /Applications/Xcode_14.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BADownload.h	2022-11-10 19:18:32
+++ /Applications/Xcode_14.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BADownload.h	2023-02-12 14:13:57
@@ -10,24 +10,69 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
-API_AVAILABLE(macos(13.0), macCatalyst(16.0), ios(16.1)) API_UNAVAILABLE(tvos, watchos)
+/// @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)) API_UNAVAILABLE(tvos, watchos);
+
+/// @brief A value that represents average priority for a download.
+FOUNDATION_EXPORT const BADownloaderPriority BADownloaderPriorityDefault
+API_AVAILABLE(macos(13.0), ios(16.1)) API_UNAVAILABLE(tvos, 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)) API_UNAVAILABLE(tvos, watchos);
+
+API_AVAILABLE(macos(13.0), ios(16.1)) API_UNAVAILABLE(tvos, 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), macCatalyst(16.0), ios(16.1)) API_UNAVAILABLE(tvos, watchos);
+API_AVAILABLE(macos(13.0), ios(16.1)) API_UNAVAILABLE(tvos, watchos);
 
 /// @brief A client defined identifier that uniquely identifies this asset.
-@property (readonly, nonatomic) NSString    *identifier
-API_AVAILABLE(macos(13.0), macCatalyst(16.0), ios(16.1)) API_UNAVAILABLE(tvos, watchos);
+@property (readonly, nonatomic) NSString *identifier
+API_AVAILABLE(macos(13.0), ios(16.1)) API_UNAVAILABLE(tvos, watchos);
 
 /// @brief A UUID that uniquely identifies the download object.
-@property (readonly, nonatomic) NSString  *uniqueIdentifier
-API_AVAILABLE(macos(13.0), macCatalyst(16.0), ios(16.1)) API_UNAVAILABLE(tvos, watchos);
+@property (readonly, nonatomic) NSString *uniqueIdentifier
+API_AVAILABLE(macos(13.0), ios(16.1)) API_UNAVAILABLE(tvos, watchos);
 
 /// @brief A client set priority to try to order downloads in order of importance
 @property (readonly) BADownloaderPriority priority
-API_AVAILABLE(macos(13.0), macCatalyst(16.0), ios(16.1)) API_UNAVAILABLE(tvos, watchos);
+API_AVAILABLE(macos(13.0), ios(16.1)) API_UNAVAILABLE(tvos, 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)) API_UNAVAILABLE(tvos, 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)) API_UNAVAILABLE(tvos, watchos)
+NS_SWIFT_NAME(asNonEssential());
 
 - (instancetype)init
 NS_UNAVAILABLE;
diff -ruN /Applications/Xcode_14.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BADownloadManager.h /Applications/Xcode_14.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BADownloadManager.h
--- /Applications/Xcode_14.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BADownloadManager.h	2022-11-10 19:18:32
+++ /Applications/Xcode_14.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BADownloadManager.h	2023-02-11 16:43:08
@@ -10,7 +10,7 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
-API_AVAILABLE(macos(13.0), macCatalyst(16.0), ios(16.1)) API_UNAVAILABLE(tvos, watchos)
+API_AVAILABLE(macos(13.0), ios(16.1)) API_UNAVAILABLE(tvos, watchos)
 @protocol BADownloadManagerDelegate <NSObject>
 
 @optional
@@ -43,7 +43,7 @@
 
 @end
 
-API_AVAILABLE(macos(13.0), macCatalyst(16.0), ios(16.1)) API_UNAVAILABLE(tvos, watchos)
+API_AVAILABLE(macos(13.0), ios(16.1)) API_UNAVAILABLE(tvos, watchos)
 @interface BADownloadManager : NSObject
 
 - (instancetype)init
@@ -53,18 +53,27 @@
 
 /// @brief Gets the singleton downloader object.
 @property (class, readonly, strong) BADownloadManager *sharedManager
-API_AVAILABLE(macos(13.0), macCatalyst(16.0), ios(16.1)) API_UNAVAILABLE(tvos, watchos)
+API_AVAILABLE(macos(13.0), ios(16.1)) API_UNAVAILABLE(tvos, 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), macCatalyst(16.0), ios(16.1)) API_UNAVAILABLE(tvos, watchos);
+API_AVAILABLE(macos(13.0), ios(16.1)) API_UNAVAILABLE(tvos, watchos);
 
-/// @brief Allows access to the set of downloads that are staged / pending for you application identifier.
-/// @discussion Allows access to the set of downloads that your application identifier has staged /pending.
-/// @param completionHandler A block to recieve the currently scheduled downloads. The block is called on the same queue as all the other completion blocks in the class.
+/// @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)) API_UNAVAILABLE(tvos, 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(^)(NSArray<BADownload *> *downloads, NSError *_Nullable error))completionHandler
-API_AVAILABLE(macos(13.0), macCatalyst(16.0), ios(16.1)) API_UNAVAILABLE(tvos, watchos)
+API_AVAILABLE(macos(13.0), ios(16.1)) API_UNAVAILABLE(tvos, watchos)
 NS_SWIFT_NAME(fetchCurrentDownloads(completionHandler:))
 NS_SWIFT_ASYNC_NAME(getter:currentDownloads());
 
@@ -76,7 +85,7 @@
 /// @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), macCatalyst(16.0), ios(16.1)) API_UNAVAILABLE(tvos, watchos);
+API_AVAILABLE(macos(13.0), ios(16.1)) API_UNAVAILABLE(tvos, 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
@@ -84,7 +93,7 @@
 /// @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 (^)(BOOL acquiredLock, NSError *_Nullable error))performHandler
-API_AVAILABLE(macos(13.0), macCatalyst(16.0), ios(16.1)) API_UNAVAILABLE(tvos, watchos)
+API_AVAILABLE(macos(13.0), ios(16.1)) API_UNAVAILABLE(tvos, watchos)
 NS_SWIFT_NAME(withExclusiveControl(_:))
 NS_SWIFT_DISABLE_ASYNC;
 
@@ -96,7 +105,7 @@
 /// If an error is non-nil then a problem occurred acquiring exclusive access.
 - (void)performWithExclusiveControlBeforeDate:(NSDate *)date
                                performHandler:(void (^)(BOOL acquiredLock, NSError *_Nullable error))performHandler
-API_AVAILABLE(macos(13.0), macCatalyst(16.0), ios(16.1)) API_UNAVAILABLE(tvos, watchos)
+API_AVAILABLE(macos(13.0), ios(16.1)) API_UNAVAILABLE(tvos, watchos)
 NS_SWIFT_NAME(withExclusiveControl(beforeDate:perform:))
 NS_SWIFT_DISABLE_ASYNC;
 
@@ -108,7 +117,7 @@
 /// with the settings BAErrorDomain : BAErrorCodeCallFromInactiveProcessNotAllowed.
 - (BOOL)startForegroundDownload:(BADownload *)download
                           error:(NSError* _Nullable __autoreleasing *)error
-API_AVAILABLE(macos(13.0), macCatalyst(16.0), ios(16.1)) API_UNAVAILABLE(tvos, watchos);
+API_AVAILABLE(macos(13.0), ios(16.1)) API_UNAVAILABLE(tvos, 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
@@ -116,7 +125,7 @@
 /// @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), macCatalyst(16.0), ios(16.1)) API_UNAVAILABLE(tvos, watchos);
+API_AVAILABLE(macos(13.0), ios(16.1)) API_UNAVAILABLE(tvos, watchos);
 
 @end
 
diff -ruN /Applications/Xcode_14.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BADownloaderExtension.h /Applications/Xcode_14.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BADownloaderExtension.h
--- /Applications/Xcode_14.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BADownloaderExtension.h	2022-11-10 19:16:11
+++ /Applications/Xcode_14.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BADownloaderExtension.h	2023-02-12 14:10:46
@@ -11,7 +11,7 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
-API_AVAILABLE(macos(13.0), macCatalyst(16.0), ios(16.1)) API_UNAVAILABLE(tvos, watchos)
+API_AVAILABLE(macos(13.0), ios(16.1)) API_UNAVAILABLE(tvos, watchos)
 NS_REFINED_FOR_SWIFT
 @protocol BADownloaderExtension <NSObject>
 
diff -ruN /Applications/Xcode_14.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BATypes.h /Applications/Xcode_14.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BATypes.h
--- /Applications/Xcode_14.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BATypes.h	2022-11-10 19:18:32
+++ /Applications/Xcode_14.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BATypes.h	2023-02-10 13:52:42
@@ -11,32 +11,6 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
-/// @typedef Download state
-typedef NS_ENUM(NSInteger, BADownloadState) {
-    BADownloadStateFailed = -1,
-    BADownloadStateCreated = 0,
-    BADownloadStateWaiting,
-    BADownloadStateDownloading,
-    BADownloadStateFinished,
-};
-
-/// @brief A downloads priority
-/// @discussion A priority to which the 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;
-
-/// @brief A value that represents the lowest priority for a download.
-FOUNDATION_EXPORT const BADownloaderPriority BADownloaderPriorityMin
-API_AVAILABLE(macos(13.0), macCatalyst(16.0), ios(16.1)) API_UNAVAILABLE(tvos, watchos);
-
-/// @brief A value that represents average priority for a download.
-FOUNDATION_EXPORT const BADownloaderPriority BADownloaderPriorityDefault
-API_AVAILABLE(macos(13.0), macCatalyst(16.0), ios(16.1)) API_UNAVAILABLE(tvos, watchos);
-
-/// @brief A value that represents the highest priority for a download.
-FOUNDATION_EXPORT const BADownloaderPriority BADownloaderPriorityMax
-API_AVAILABLE(macos(13.0), macCatalyst(16.0), ios(16.1)) API_UNAVAILABLE(tvos, watchos);
-
 /// @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.
diff -ruN /Applications/Xcode_14.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAURLDownload.h /Applications/Xcode_14.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAURLDownload.h
--- /Applications/Xcode_14.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAURLDownload.h	2022-11-10 19:18:32
+++ /Applications/Xcode_14.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAURLDownload.h	2023-02-11 16:43:08
@@ -10,35 +10,67 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
-API_AVAILABLE(macos(13.0), macCatalyst(16.0), ios(16.1)) API_UNAVAILABLE(tvos, watchos)
-@interface BAURLDownload : BADownload
+API_AVAILABLE(macos(13.0), ios(16.1)) API_UNAVAILABLE(tvos, watchos)
+@interface BAURLDownload : BADownload<NSCopying>
 
 + (instancetype)new NS_UNAVAILABLE;
 - (instancetype)init NS_UNAVAILABLE;
 
-
-/// @brief Inits a download object to represent the download of a asset at a url represented in @c request
-/// @discussion Inits a download object to represent a download of a asset at a url wrapped in @c request. This URL most be of the scheme https.
-/// The download object then holds onto the state and callbacks for managing the states of download while the service handles.
-/// @param request The request to use to start the download.
+/// @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.  If the @c fileSize is not accurate, then the download will fail if @c isEssential is true.
 /// @param applicationGroupIdentifier The identifier of the application group that should used to store the finished download.
-- (instancetype)initWithIdentifier:(NSString * )identifier
+- (instancetype)initWithIdentifier:(NSString *)identifier
                            request:(NSURLRequest *)request
+                          fileSize:(NSUInteger)fileSize
         applicationGroupIdentifier:(NSString *)applicationGroupIdentifier
-API_AVAILABLE(macos(13.0), macCatalyst(16.0), ios(16.1)) API_UNAVAILABLE(tvos, watchos);
+API_AVAILABLE(macos(13.3), ios(16.4)) API_UNAVAILABLE(tvos, watchos);
 
-/// @brief Inits a download object to represent the download of a asset at a url represented in @c request
-/// @discussion Inits a download object to represent a download of a asset at a url wrapped in @c request. This URL most be of the scheme https.
-/// The download object then holds onto the state and callbacks for managing the states of download while the service handles.
-/// @param request The request to use to start the download.
+/// @abstract Constructs a download object to represent the download of a asset located inside of the provided @c request.
+/// @param identifier A unique identifier that is used to track the download across the app and extension.
+/// @param request The request used to perform the download. The URL provided inside of the request must be a https scheme.
+/// @param essential Whether the download is essential. See @c BADownload.isEssential. Default is false.
+/// @param fileSize The size of the file to download. For Essential downloads, this field must be accurate in order to show the user
+/// accurate progress during app installation. If the size does not match the file being downloaded, then the download will fail. It is recommended to
+/// report an accurate @c fileSize for both Essential and Non-Essential downloads.
 /// @param applicationGroupIdentifier The identifier of the application group that should used to store the finished download.
-/// @param priority A unsigned integer priority between BADownloaderPriorityMin - BADownloaderPriorityMax which is used to order the downloads for this process.
-- (instancetype)initWithIdentifier:(NSString * )identifier
+/// @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.0), macCatalyst(16.0), ios(16.1)) API_UNAVAILABLE(tvos, watchos);
+API_AVAILABLE(macos(13.3), ios(16.4)) API_UNAVAILABLE(tvos, 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);
+
+/// @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);
 
 @end
 
Clone this wiki locally