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, refCon: Any?)

    Parameters

    sessionConnectionIsValid

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

    refCon

    This is an optional Any parameter that is simply returning attached data to the delegate. The data is sent during the initial call. “refCon” is a very old concept, that stands for “Reference Context.” It allows the caller of an async operation to attach context to a call.

  • 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, refCon: Any?)

    Parameters

    loginValid

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

    refCon

    This is an optional Any parameter that is simply returning attached data to the delegate. The data is sent during the initial call. “refCon” is a very old concept, that stands for “Reference Context.” It allows the caller of an async operation to attach context to a call.

  • 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, refCon: Any?)

    Parameters

    sessionDisconnectedBecause

    The reason for the disconnection.

    refCon

    This is an optional Any parameter that is simply returning attached data to the delegate. The data is sent during the initial call. “refCon” is a very old concept, that stands for “Reference Context.” It allows the caller of an async operation to attach context to a call.

  • 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, refCon: Any?)

    Parameters

    sessionError

    The error in question.

    refCon

    This is an optional Any parameter that is simply returning attached data to the delegate. The data is sent during the initial call. “refCon” is a very old concept, that stands for “Reference Context.” It allows the caller of an async operation to attach context to a call.

  • 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], refCon: Any?)

    Parameters

    fetchedDataItems

    An array of subclasses of A_RVP_IOS_SDK_Object.

    refCon

    This is an optional Any parameter that is simply returning attached data to the delegate. The data is sent during the initial call. “refCon” is a very old concept, that stands for “Reference Context.” It allows the caller of an async operation to attach context to a call.

  • This is a response to a new token creation request.

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

    Declaration

    Swift

    func sdkInstance(_: RVP_Cocoa_SDK, newSecurityTokens: [Int], refCon: Any?)

    Parameters

    newSecurityTokens

    An Array of new security token IDs.

    refCon

    This is an optional Any parameter that is simply returning attached data to the delegate. The data is sent during the initial call. “refCon” is a very old concept, that stands for “Reference Context.” It allows the caller of an async operation to attach context to a call.

  • This is a response to the count how many logins have access to a token test.

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

    Declaration

    Swift

    func sdkInstance(_: RVP_Cocoa_SDK, tokenAccessTest: [Int : Int], refCon: Any?)

    Parameters

    tokenAccessTest

    A dictionary, with the keys being a token, and the values being how many logins have access to that token.

    refCon

    This is an optional Any parameter that is simply returning attached data to the delegate. The data is sent during the initial call. “refCon” is a very old concept, that stands for “Reference Context.” It allows the caller of an async operation to attach context to a call.

  • This is a response to the token catalog request (fetchAllTokensFromServer).

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

    Declaration

    Swift

    func sdkInstance(_: RVP_Cocoa_SDK, tokenList: [RVP_Cocoa_SDK.TokenType], refCon: Any?)

    Parameters

    tokenList

    An Array of Token Type Enum values. Some may have associated data.

    refCon

    This is an optional Any parameter that is simply returning attached data to the delegate. The data is sent during the initial call. “refCon” is a very old concept, that stands for “Reference Context.” It allows the caller of an async operation to attach context to a call.

  • This is a response to the count how many logins have access to a token test.

    This version of the call is security-restricted, so the IDs will only be for logins that the current login can see.

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

    Declaration

    Swift

    func sdkInstance(_: RVP_Cocoa_SDK, tokenAccessTest: (token: Int, logins: [Int]), refCon: Any?)

    Parameters

    tokenAccessTest

    A tuple, containing the tested token (“token”), and the IDs of the logins (not users) that have the token (“logins”).

    refCon

    This is an optional Any parameter that is simply returning attached data to the delegate. The data is sent during the initial call. “refCon” is a very old concept, that stands for “Reference Context.” It allows the caller of an async operation to attach context to a call.

  • This is a response to the count how many users have access to a token test.

    This version of the call is security-restricted, so the IDs will only be for users that the current login can see.

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

    Declaration

    Swift

    func sdkInstance(_: RVP_Cocoa_SDK, tokenAccessTest: (token: Int, users: [Int]), refCon: Any?)

    Parameters

    tokenAccessTest

    A tuple, containing the tested token (“token”), and the IDs of the users (not logins) that have the token (“users”).

    refCon

    This is an optional Any parameter that is simply returning attached data to the delegate. The data is sent during the initial call. “refCon” is a very old concept, that stands for “Reference Context.” It allows the caller of an async operation to attach context to a call.

  • This is a response to the get a fast list of available users and IDs. We will use this for things like auto-populating search boxes.

    This version of the call is security-restricted, so the IDs will only be for users that the current login can see.

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

    Declaration

    Swift

    func sdkInstance(_: RVP_Cocoa_SDK, fastUserList: [Int : String], refCon: Any?)

    Parameters

    fastUserList

    Dictionary, indexed by the integer user (not login) ID, and a string value, containing the display name for that user.

    refCon

    This is an optional Any parameter that is simply returning attached data to the delegate. The data is sent during the initial call. “refCon” is a very old concept, that stands for “Reference Context.” It allows the caller of an async operation to attach context to a call.

  • 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], refCon: Any?)

    Parameters

    deletedDataItems

    An array of subclasses of A_RVP_IOS_SDK_Object.

    refCon

    This is an optional Any parameter that is simply returning attached data to the delegate. The data is sent during the initial call. “refCon” is a very old concept, that stands for “Reference Context.” It allows the caller of an async operation to attach context to a call.

  • 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, refCon: Any?)

    Parameters

    newObject

    The newly-created object.

    refCon

    This is an optional Any parameter that is simply returning attached data to the delegate. The data is sent during the initial call. “refCon” is a very old concept, that stands for “Reference Context.” It allows the caller of an async operation to attach context to a call.

  • This is called when an object has been changed in the system.

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

    Declaration

    Swift

    func sdkInstance(_: RVP_Cocoa_SDK, changedObject: A_RVP_Cocoa_SDK_Object, refCon: Any?)

    Parameters

    changedObject

    The changed object.

    refCon

    This is an optional Any parameter that is simply returning attached data to the delegate. The data is sent during the initial call. “refCon” is a very old concept, that stands for “Reference Context.” It allows the caller of an async operation to attach context to a call.

  • This is called with zero or more IDs. Baseline 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, refCon: Any?)

    Parameters

    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.

    refCon

    This is an optional Any parameter that is simply returning attached data to the delegate. The data is sent during the initial call. “refCon” is a very old concept, that stands for “Reference Context.” It allows the caller of an async operation to attach context to a call.

  • 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, refCon: Any?)

    Parameters

    refCon

    This is an optional Any parameter that is simply returning attached data to the delegate. The data is sent during the initial call. “refCon” is a very old concept, that stands for “Reference Context.” It allows the caller of an async operation to attach context to a 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, refCon: Any?)

    Parameters

    refCon

    This is an optional Any parameter that is simply returning attached data to the delegate. The data is sent during the initial call. “refCon” is a very old concept, that stands for “Reference Context.” It allows the caller of an async operation to attach context to a call.