ParseLiveQueryDelegate

@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
public protocol ParseLiveQueryDelegate : AnyObject

Receive/respond to notifications from the ParseLiveQuery Server.

  • 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.

    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.

    Declaration

    Swift

    func received(_ error: ParseError)

    Parameters

    error

    An error from the session task.

  • Receive unsupported data from the ParseLiveQuery task/connection.

    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.