RVP_Cocoa_SDK_Delegate

public protocol RVP_Cocoa_SDK_Delegate : AnyObject

This protocol needs to be applied to any class that will use the SDK. The SDK requires a delegate.

All methods are required.

These are likely to be called in non-main threads, so caveat emptor.

  • This is called when a server session (not login) is started or ended. If the connection was invalidated, then sessionDisconnectedBecause will also be called after this.

    NOTE: This is not guaranteed to be called in the main thread!

    Declaration

    Swift

    func sdkInstance(_: RVP_Cocoa_SDK, sessionConnectionIsValid: Bool)

    Parameters

    sdkInstance

    This is the SDK instance making the call.

    sessionConnectionIsValid

    A Bool, true, if the SDK is currently in a valid session with a server.

  • This is called when the server has completed its login sequence, and all is considered OK. The server should not be considered usable until after this method has been called with true.

    NOTE: This is not guaranteed to be called in the main thread!

    Declaration

    Swift

    func sdkInstance(_: RVP_Cocoa_SDK, loginValid: Bool)

    Parameters

    sdkInstance

    This is the SDK instance making the call.

    liginValid

    A Bool, true, if the SDK is currently logged in.

  • This is called when the SDK instance disconnects from the server.

    NOTE: This is not guaranteed to be called in the main thread!

    Declaration

    Swift

    func sdkInstance(_: RVP_Cocoa_SDK, sessionDisconnectedBecause: RVP_Cocoa_SDK.DisconnectionReason)

    Parameters

    sdkInstance

    This is the SDK instance making the call.

    sessionDisconnectedBecause

    The reason for the disconnection.

  • This is called when there is an error in the SDK instance.

    NOTE: This is not guaranteed to be called in the main thread!

    Declaration

    Swift

    func sdkInstance(_: RVP_Cocoa_SDK, sessionError: Error)

    Parameters

    sdkInstance

    This is the SDK instance making the call.

    sessionError

    The error in question.

  • This is called with one or more data items. Each item is a single object. In an auto-radius search, this may be called repeatedly.

    NOTE: This is not guaranteed to be called in the main thread!

    Declaration

    Swift

    func sdkInstance(_: RVP_Cocoa_SDK, fetchedDataItems: [A_RVP_Cocoa_SDK_Object])

    Parameters

    sdkInstance

    This is the SDK instance making the call.

    fetchedDataItems

    An array of subclasses of A_RVP_IOS_SDK_Object.

  • This is called with one or more data items. Each item is a single object. This returns the items that were deleted (they no longer exist) in the database.

    NOTE: This is not guaranteed to be called in the main thread!

    Declaration

    Swift

    func sdkInstance(_: RVP_Cocoa_SDK, deletedDataItems: [A_RVP_Cocoa_SDK_Object])

    Parameters

    sdkInstance

    This is the SDK instance making the call.

    deletedDataItems

    An array of subclasses of A_RVP_IOS_SDK_Object.

  • This is called when a new object has been created in the system. It is called once per new object, just before sdkInstance(_:,fetchedDataItems:), which will be called with the same object, in an Array of one element.

    NOTE: This is not guaranteed to be called in the main thread!

    Declaration

    Swift

    func sdkInstance(_: RVP_Cocoa_SDK, newObject: A_RVP_Cocoa_SDK_Object)

    Parameters

    sdkInstance

    This is the SDK instance making the call.

    newObject

    The newly-created object.

  • This is called with zero or more IDs. Base;ine searches are a two-step process, where IDs are fetched first, then objects. This call is made between the two steps. In the case of auto-radius, the second step is not done until the end, so this is the only indication of progress. In an auto-radius search, this will be called repeatedly, but the actual objects will not be fetched until the final call.

    NOTE: This is not guaranteed to be called in the main thread!

    Declaration

    Swift

    func sdkInstance(_: RVP_Cocoa_SDK, baselineAutoRadiusIDs: [Int], isFinal: Bool)

    Parameters

    sdkInstance

    This is the SDK instance making the call.

    baselineAutoRadiusIDs

    An array of Int. This contains the current IDs for the interim step of a baseline search.

    isFinal

    This is true, if this was the last call for an auto-radius search. Remember that the call may be made before the threshold has been reached.

  • This is called when the last auto-radius call has been made. This is called BEFORE the results of that call come, so keep in mind that it is not the last. You should wait for sdkInstanceOperationComplete() to be called.

    NOTE: This is not guaranteed to be called in the main thread!

    Declaration

    Swift

    func sdkInstanceFinalAutoRadiusCall(_: RVP_Cocoa_SDK)

    Parameters

    sdkInstance

    This is the SDK instance making the call.

  • This is called when an operation is complete.

    NOTE: This is not guaranteed to be called in the main thread!

    Declaration

    Swift

    func sdkInstanceOperationComplete(_: RVP_Cocoa_SDK)

    Parameters

    sdkInstance

    This is the SDK instance making the call.