Swift SDK Version

GraphRequestProtocol

publicprotocolGraphRequestProtocol
Protocol that represents a request to the Facebook Graph API.
An implementation of this protocol is intended to be either generic and be used for a lot of separate endpoints, or encapsulate a request + response type for a single endpoint, for example Profile.
To send a request and receive a response - see GraphRequestConnection.
Nearly all Graph APIs require an access token. Unless specified, the AccessToken.current is used. Therefore, most requests will require login first (see LoginManager in FacebookLogin.framework).
A start function is provided for convenience for single requests.
  • start(_:) Extension method
    A convenience method that creates and starts a connection to the Graph API.

    Declaration

    Swift
    publicfuncstart(_completion:GraphRequestConnection.Completion<Self>?=nil)

    Parameters

    completion
    Optional completion closure that is going to be called when the connection finishes or fails.