iOS SDK Version

FBSDKGraphRequestConnectionDelegate

@protocolFBSDKGraphRequestConnectionDelegate<NSObject>
@protocol
The FBSDKGraphRequestConnectionDelegate protocol defines the methods used to receive network activity progress information from a
.
  • @method
    Tells the delegate the request connection will begin loading
    If the
    is created using one of the convenience factory methods prefixed with start, the object returned from the convenience method has already begun loading and this method will not be called when the delegate is set.

    Declaration

    Objective-C
    -(void)requestConnectionWillBeginLoading:(nonnullFBSDKGraphRequestConnection*)connection;
    Swift
    optionalfuncrequestConnectionWillBeginLoading(_connection:GraphRequestConnection)

    Parameters

    connection
    The request connection that is starting a network request
  • @method
    Tells the delegate the request connection finished loading
    If the request connection completes without a network error occurring then this method is called. Invocation of this method does not indicate success of every
    made, only that the request connection has no further activity. Use the error argument passed to the FBSDKGraphRequestBlock block to determine success or failure of each
    .
    This method is invoked after the completion handler for each
    .

    Declaration

    Objective-C
    -(void)requestConnectionDidFinishLoading:(nonnullFBSDKGraphRequestConnection*)connection;
    Swift
    optionalfuncrequestConnectionDidFinishLoading(_connection:GraphRequestConnection)

    Parameters

    connection
    The request connection that successfully completed a network request
  • @method
    Tells the delegate the request connection failed with an error
    If the request connection fails with a network error then this method is called. The error argument specifies why the network connection failed. The NSError object passed to the FBSDKGraphRequestBlock block may contain additional information.

    Declaration

    Objective-C
    -(void)requestConnection:(nonnullFBSDKGraphRequestConnection*)connectiondidFailWithError:(nonnullNSError*)error;
    Swift
    optionalfuncrequestConnection(_connection:GraphRequestConnection,didFailWithErrorerror:Error)

    Parameters

    connection
    The request connection that successfully completed a network request
    error
    The NSError representing the network error that occurred, if any. May be nil in some circumstances. Consult the NSError for the
    for reliable failure information.
  • @method
    Tells the delegate how much data has been sent and is planned to send to the remote host
    The byte count arguments refer to the aggregated
    objects, not a particular
    .
    Like NSURLSession, the values may change in unexpected ways if data needs to be resent.

    Declaration

    Objective-C
    -(void)requestConnection:(nonnullFBSDKGraphRequestConnection*)connectiondidSendBodyData:(NSInteger)bytesWrittentotalBytesWritten:(NSInteger)totalBytesWrittentotalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite;
    Swift
    optionalfuncrequestConnection(_connection:GraphRequestConnection,didSendBodyDatabytesWritten:Int,totalBytesWritten:Int,totalBytesExpectedToWrite:Int)

    Parameters

    connection
    The request connection transmitting data to a remote host
    bytesWritten
    The number of bytes sent in the last transmission
    totalBytesWritten
    The total number of bytes sent to the remote host
    totalBytesExpectedToWrite
    The total number of bytes expected to send to the remote host