ParseLiveQueryDelegate

public protocol ParseLiveQueryDelegate : AnyObject

Receive/respond to notifications from the ParseLiveQuery Server.

  • received(_:completionHandler:) Default implementation

    Respond to authentication requests from a ParseLiveQuery Server. If you become a delegate and implement this method you will need to with completionHandler(.performDefaultHandling, nil) to accept all connections approved by the OS. Becoming a delegate allows you to make authentication decisions for all connections in the ParseLiveQuery session, meaning there can only be one delegate for the whole session. The newest instance to become the delegate will be the only one to receive authentication challenges.

    See Apple’s documentation for more for details.

    Default Implementation

    Declaration

    Swift

    func received(_ challenge: URLAuthenticationChallenge,
                  completionHandler: @escaping (URLSession.AuthChallengeDisposition,
                                                URLCredential?) -> Void)

    Parameters

    challenge

    An object that contains the request for authentication.

    completionHandler

    A handler that your delegate method must call. Its parameters are:

    • disposition - One of several constants that describes how the challenge should be handled.
    • credential - The credential that should be used for authentication if disposition is URLSessionAuthChallengeUseCredential; otherwise, nil.

  • Receive errors from the ParseLiveQuery task/connection.

    Note

    The type of error received can vary from ParseError, URLError, POSIXError, etc.

    Declaration

    Swift

    func received(_ error: Error)

    Parameters

    error

    An error from the session task.

  • receivedUnsupported(_:socketMessage:) Default implementation

    Receive unsupported data from the ParseLiveQuery task/connection.

    Default Implementation

    Declaration

    Swift

    func receivedUnsupported(_ data: Data?, socketMessage: URLSessionWebSocketTask.Message?)

    Parameters

    error

    An error from the session task.

  • Receive metrics about the ParseLiveQuery task/connection.

    Declaration

    Swift

    func received(_ metrics: URLSessionTaskTransactionMetrics)

    Parameters

    metrics

    An object that encapsualtes the performance metrics collected by the URL Loading System during the execution of a session task. See Apple’s documentation for more for details.

  • closedSocket(_:reason:) Default implementation

    Receive notifications when the ParseLiveQuery closes a task/connection.

    Default Implementation

    Declaration

    Swift

    func closedSocket(_ code: URLSessionWebSocketTask.CloseCode?, reason: Data?)

    Parameters

    code

    The close code provided by the server.

    reason

    The close reason provided by the server. If the close frame didn’t include a reason, this value is nil.