public interface WKDownloadDelegate
| Modifier and Type | Interface and Description |
|---|---|
static interface |
WKDownloadDelegate.Block_downloadDecideDestinationUsingResponseSuggestedFilenameCompletionHandler |
static interface |
WKDownloadDelegate.Block_downloadDidReceiveAuthenticationChallengeCompletionHandler |
static interface |
WKDownloadDelegate.Block_downloadWillPerformHTTPRedirectionNewRequestDecisionHandler |
void downloadDecideDestinationUsingResponseSuggestedFilenameCompletionHandler(WKDownload download, NSURLResponse response, java.lang.String suggestedFilename, WKDownloadDelegate.Block_downloadDecideDestinationUsingResponseSuggestedFilenameCompletionHandler completionHandler)
suggestedFilename will often be the same as response.suggestedFilename, but web content can specify the suggested download filename. If the destination file URL is non-null, it must be a file that does not exist in a directory that does exist and can be written to.
download - The download for which we need a file to which to write.response - The server response if this download was the result of an HTTP request,
or a synthesized response for blob downloads.suggestedFilename - The suggested filename.completionHandler - The completion handler you must invoke with
either a file URL to begin the download or nil to cancel the download.default void downloadDidFailWithErrorResumeData(WKDownload download, NSError error, NSData resumeData)
download - The download that has failed.error - The error indicating the failure reason.resumeData - This data can be passed to WKWebView resumeDownloadFromResumeData: to attempt to resume this download.default void downloadDidReceiveAuthenticationChallengeCompletionHandler(WKDownload download, NSURLAuthenticationChallenge challenge, WKDownloadDelegate.Block_downloadDidReceiveAuthenticationChallengeCompletionHandler completionHandler)
If you do not implement this method, the web view will respond to the authentication challenge with the NSURLSessionAuthChallengeRejectProtectionSpace disposition.
download - The download that received the authentication challenge.challenge - The authentication challenge.completionHandler - The completion handler you must invoke to respond to the challenge. The
disposition argument is one of the constants of the enumerated type
NSURLSessionAuthChallengeDisposition. When disposition is NSURLSessionAuthChallengeUseCredential,
the credential argument is the credential to use, or nil to indicate continuing without a
credential.default void downloadWillPerformHTTPRedirectionNewRequestDecisionHandler(WKDownload download, NSHTTPURLResponse response, NSURLRequest request, WKDownloadDelegate.Block_downloadWillPerformHTTPRedirectionNewRequestDecisionHandler decisionHandler)
If you do not implement this method, all server suggested redirects will be taken.
download - The download that received the redirect.response - The redirection response.newRequest - The new request that will be sent.completionHandler - The completion handler you must invoke to indicate whether or not
to proceed with the redirection.default void downloadDidFinish(WKDownload download)
download - The download that finished.