Package apple.foundation.protocol
Interface NSURLSessionTaskDelegate
-
- All Superinterfaces:
NSURLSessionDelegate
- All Known Subinterfaces:
AVAssetDownloadDelegate,NSURLSessionDataDelegate,NSURLSessionDownloadDelegate,NSURLSessionStreamDelegate,NSURLSessionWebSocketDelegate
public interface NSURLSessionTaskDelegate extends NSURLSessionDelegate
Messages related to the operation of a specific task.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceNSURLSessionTaskDelegate.Block_URLSessionTaskDidReceiveChallengeCompletionHandlerstatic interfaceNSURLSessionTaskDelegate.Block_URLSessionTaskNeedNewBodyStreamstatic interfaceNSURLSessionTaskDelegate.Block_URLSessionTaskWillBeginDelayedRequestCompletionHandlerstatic interfaceNSURLSessionTaskDelegate.Block_URLSessionTaskWillPerformHTTPRedirectionNewRequestCompletionHandler-
Nested classes/interfaces inherited from interface apple.foundation.protocol.NSURLSessionDelegate
NSURLSessionDelegate.Block_URLSessionDidReceiveChallengeCompletionHandler
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default voidURLSessionTaskDidCompleteWithError(NSURLSession session, NSURLSessionTask task, NSError error)Sent as the last message related to a specific task.default voidURLSessionTaskDidFinishCollectingMetrics(NSURLSession session, NSURLSessionTask task, NSURLSessionTaskMetrics metrics)Sent when complete statistics information has been collected for the task.default voidURLSessionTaskDidReceiveChallengeCompletionHandler(NSURLSession session, NSURLSessionTask task, NSURLAuthenticationChallenge challenge, NSURLSessionTaskDelegate.Block_URLSessionTaskDidReceiveChallengeCompletionHandler completionHandler)The task has received a request specific authentication challenge.default voidURLSessionTaskDidSendBodyDataTotalBytesSentTotalBytesExpectedToSend(NSURLSession session, NSURLSessionTask task, long bytesSent, long totalBytesSent, long totalBytesExpectedToSend)Sent periodically to notify the delegate of upload progress.default voidURLSessionTaskIsWaitingForConnectivity(NSURLSession session, NSURLSessionTask task)Sent when a task cannot start the network loading process because the current network connectivity is not available or sufficient for the task's request.default voidURLSessionTaskNeedNewBodyStream(NSURLSession session, NSURLSessionTask task, NSURLSessionTaskDelegate.Block_URLSessionTaskNeedNewBodyStream completionHandler)Sent if a task requires a new, unopened body stream.default voidURLSessionTaskWillBeginDelayedRequestCompletionHandler(NSURLSession session, NSURLSessionTask task, NSURLRequest request, NSURLSessionTaskDelegate.Block_URLSessionTaskWillBeginDelayedRequestCompletionHandler completionHandler)Sent when the system is ready to begin work for a task with a delayed start time set (using the earliestBeginDate property).default voidURLSessionTaskWillPerformHTTPRedirectionNewRequestCompletionHandler(NSURLSession session, NSURLSessionTask task, NSHTTPURLResponse response, NSURLRequest request, NSURLSessionTaskDelegate.Block_URLSessionTaskWillPerformHTTPRedirectionNewRequestCompletionHandler completionHandler)An HTTP request is attempting to perform a redirection to a different URL.-
Methods inherited from interface apple.foundation.protocol.NSURLSessionDelegate
URLSessionDidBecomeInvalidWithError, URLSessionDidFinishEventsForBackgroundURLSession, URLSessionDidReceiveChallengeCompletionHandler
-
-
-
-
Method Detail
-
URLSessionTaskDidCompleteWithError
default void URLSessionTaskDidCompleteWithError(NSURLSession session, NSURLSessionTask task, NSError error)
Sent as the last message related to a specific task. Error may be nil, which implies that no error occurred and this task is complete.
-
URLSessionTaskDidFinishCollectingMetrics
default void URLSessionTaskDidFinishCollectingMetrics(NSURLSession session, NSURLSessionTask task, NSURLSessionTaskMetrics metrics)
Sent when complete statistics information has been collected for the task.
-
URLSessionTaskDidReceiveChallengeCompletionHandler
default void URLSessionTaskDidReceiveChallengeCompletionHandler(NSURLSession session, NSURLSessionTask task, NSURLAuthenticationChallenge challenge, NSURLSessionTaskDelegate.Block_URLSessionTaskDidReceiveChallengeCompletionHandler completionHandler)
The task has received a request specific authentication challenge. If this delegate is not implemented, the session specific authentication challenge will *NOT* be called and the behavior will be the same as using the default handling disposition.
-
URLSessionTaskDidSendBodyDataTotalBytesSentTotalBytesExpectedToSend
default void URLSessionTaskDidSendBodyDataTotalBytesSentTotalBytesExpectedToSend(NSURLSession session, NSURLSessionTask task, long bytesSent, long totalBytesSent, long totalBytesExpectedToSend)
Sent periodically to notify the delegate of upload progress. This information is also available as properties of the task.
-
URLSessionTaskNeedNewBodyStream
default void URLSessionTaskNeedNewBodyStream(NSURLSession session, NSURLSessionTask task, NSURLSessionTaskDelegate.Block_URLSessionTaskNeedNewBodyStream completionHandler)
Sent if a task requires a new, unopened body stream. This may be necessary when authentication has failed for any request that involves a body stream.
-
URLSessionTaskWillPerformHTTPRedirectionNewRequestCompletionHandler
default void URLSessionTaskWillPerformHTTPRedirectionNewRequestCompletionHandler(NSURLSession session, NSURLSessionTask task, NSHTTPURLResponse response, NSURLRequest request, NSURLSessionTaskDelegate.Block_URLSessionTaskWillPerformHTTPRedirectionNewRequestCompletionHandler completionHandler)
An HTTP request is attempting to perform a redirection to a different URL. You must invoke the completion routine to allow the redirection, allow the redirection with a modified request, or pass nil to the completionHandler to cause the body of the redirection response to be delivered as the payload of this request. The default is to follow redirections. For tasks in background sessions, redirections will always be followed and this method will not be called.
-
URLSessionTaskWillBeginDelayedRequestCompletionHandler
default void URLSessionTaskWillBeginDelayedRequestCompletionHandler(NSURLSession session, NSURLSessionTask task, NSURLRequest request, NSURLSessionTaskDelegate.Block_URLSessionTaskWillBeginDelayedRequestCompletionHandler completionHandler)
Sent when the system is ready to begin work for a task with a delayed start time set (using the earliestBeginDate property). The completionHandler must be invoked in order for loading to proceed. The disposition provided to the completion handler continues the load with the original request provided to the task, replaces the request with the specified task, or cancels the task. If this delegate is not implemented, loading will proceed with the original request. Recommendation: only implement this delegate if tasks that have the earliestBeginDate property set may become stale and require alteration prior to starting the network load. If a new request is specified, the allowsExpensiveNetworkAccess, allowsContrainedNetworkAccess, and allowsCellularAccess properties from the new request will not be used; the properties from the original request will continue to be used. Canceling the task is equivalent to calling the task's cancel method; the URLSession:task:didCompleteWithError: task delegate will be called with error NSURLErrorCancelled.
-
URLSessionTaskIsWaitingForConnectivity
default void URLSessionTaskIsWaitingForConnectivity(NSURLSession session, NSURLSessionTask task)
Sent when a task cannot start the network loading process because the current network connectivity is not available or sufficient for the task's request. This delegate will be called at most one time per task, and is only called if the waitsForConnectivity property in the NSURLSessionConfiguration has been set to YES. This delegate callback will never be called for background sessions, because the waitForConnectivity property is ignored by those sessions.
-
-