Contents

download(_:didReceive:completionHandler:)

Tells the delegate to resolve the specified URL authentication challenge.

Declaration

optional func download(_ download: BADownload, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping  @Sendable (URLSession.AuthChallengeDisposition, URLCredential?) -> Void)
optional func download(_ download: BADownload, didReceive challenge: URLAuthenticationChallenge) async -> (URLSession.AuthChallengeDisposition, URLCredential?)

Parameters

  • download:

    The associated asset download.

  • challenge:

    An object that provides the information you need to decide how to respond to the server’s request for authentication.

  • completionHandler:

    The completion handler you call to tell the system how to respond to the challenge.

Discussion

The completion handler takes the following parameters:

If you implement this method, make sure to call the completion handler promptly and with the necessary information. Otherwise, the server may deny the request and the associated asset download fails.

For more information about authentication challenges, see Handling an authentication challenge.

See Also

Reacting to download events