Package apple.backgroundassets.protocol
Interface BADownloaderExtension
-
public interface BADownloaderExtensionAPI-Since: 16.1
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceBADownloaderExtension.Block_backgroundDownloadDidReceiveChallengeCompletionHandler
-
Method Summary
All Methods Instance Methods Default Methods Deprecated Methods Modifier and Type Method Description default voidbackgroundDownloadDidReceiveChallengeCompletionHandler(@NotNull BADownload download, @NotNull NSURLAuthenticationChallenge challenge, @NotNull BADownloaderExtension.Block_backgroundDownloadDidReceiveChallengeCompletionHandler completionHandler)Download is about to begin but requires an authentication challenge to continue.default voidbackgroundDownloadFailedWithError(@NotNull BADownload download, @NotNull NSError error)This method is called when a download has failed but there is no `BADownloadManager` delegate to handle the completion event.default voidbackgroundDownloadFinishedWithFileURL(@NotNull BADownload download, @NotNull NSURL fileURL)This method is called when a download has finished but there is no `BADownloadManager` delegate to handle the completion event.default @NotNull NSSet<? extends BADownload>downloadsForRequestManifestURLExtensionInfo(long contentRequest, @NotNull NSURL manifestURL, @NotNull BAAppExtensionInfo extensionInfo)Invoked by the system when the extension should check for updated content.default voidextensionWillTerminate()Deprecated.
-
-
-
Method Detail
-
backgroundDownloadDidReceiveChallengeCompletionHandler
default void backgroundDownloadDidReceiveChallengeCompletionHandler(@NotNull @NotNull BADownload download, @NotNull @NotNull NSURLAuthenticationChallenge challenge, @NotNull @NotNull BADownloaderExtension.Block_backgroundDownloadDidReceiveChallengeCompletionHandler completionHandler)Download is about to begin but requires an authentication challenge to continue.
-
backgroundDownloadFailedWithError
default void backgroundDownloadFailedWithError(@NotNull @NotNull BADownload download, @NotNull @NotNull NSError error)This method is called when a download has failed but there is no `BADownloadManager` delegate to handle the completion event. When a download has failed, this method will be invoked. If a download fails you may reschedule it with `BADownloadManager`.- Parameters:
download- The download object that has failed.error- The error that caused the failure.
-
backgroundDownloadFinishedWithFileURL
default void backgroundDownloadFinishedWithFileURL(@NotNull @NotNull BADownload download, @NotNull @NotNull NSURL fileURL)This method is called when a download has finished but there is no `BADownloadManager` delegate to handle the completion event. 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.- Parameters:
download- Download that has completed successfully.fileURL- A location to the file that has been downloaded.
-
downloadsForRequestManifestURLExtensionInfo
@NotNull default @NotNull NSSet<? extends BADownload> downloadsForRequestManifestURLExtensionInfo(long contentRequest, @NotNull @NotNull NSURL manifestURL, @NotNull @NotNull BAAppExtensionInfo extensionInfo)
Invoked by the system when the extension should check for updated content. 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. [@warning] You cannot use `BADownloadManager` to manually schedule downloads using this method. All downloads to enqueue must be returned.- Parameters:
contentRequest- The content request event that occured that caused this method to be invoked.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.extensionInfo- Information about your extension that may be useful for making a decision about what content needs to be scheduled.- Returns:
- A set of unique `BAURLDownload` objects that the extension should schedule for download.
-
extensionWillTerminate
@Deprecated default void extensionWillTerminate()
Deprecated.This method may be called shortly before the extension is terminated. 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. API-Since: 16.1 Deprecated-Since: 16.4 Deprecated-Message: extensionWillTerminate will not be invoked in all applicable circumstances and should not be relied upon.
-
-