CISStorageProtocol

@protocol CISStorageProtocol <NSObject>

Class conforming to this will be responsible for implementing required methods for storing data, this is used by the Conviva library to store required data.The underlying storage technology must be reliable and data must be persisted for as long as possible.

  • Save data on local storage. Will be called when first calling Client.createSession on a new device.

    Declaration

    Objective-C

    - (void)saveData:(NSString *)storageSpace
          storageKey:(NSString *)storageKey
                data:(NSString *)data
            callback:(id<CISCallback_RunnableProtocol>)callbackDelegate;

    Swift

    func saveData(_ storageSpace: Any!, storageKey: Any!, data: Any!, callback callbackDelegate: CISCallback_RunnableProtocol!)

    Parameters

    storageSpace

    Namespace to store local data into.

    storageKey

    Key to store local data into.

    data

    Data to be saved.

    callbackDelegate

    Callback to call when done. If the query was successful, it must be true even if the returned data was null/empty. If storage data is not persisted or persistence is flaky for your device, please contact Conviva for more information.

  • Load data from local storage. Will be called when creating a client.

    Declaration

    Objective-C

    - (void)loadData:(NSString *)storageSpace
          storageKey:(NSString *)storageKey
            callback:(id<CISCallback_RunnableProtocol>)callbackDelegate;

    Swift

    func loadData(_ storageSpace: Any!, storageKey: Any!, callback callbackDelegate: CISCallback_RunnableProtocol!)

    Parameters

    storageSpace

    Namespace to load local data from.

    storageKey

    Key to load local data from.

    callbackDelegate

    Callback to call when done. If the query was successful, it must be true even if the returned data was null/empty. Returned data can be still null if Conviva data was never saved before.

  • Delete data from local storage.

    Declaration

    Objective-C

    - (void)deleteData:(NSString *)storageSpace
            storageKey:(NSString *)storageKey
              callback:(id<CISCallback_RunnableProtocol>)callbackDelegate;

    Swift

    func deleteData(_ storageSpace: Any!, storageKey: Any!, callback callbackDelegate: CISCallback_RunnableProtocol!)

    Parameters

    storageSpace

    Namespace to delete local data from.

    storageKey

    Key to delete local data from.

    callbackDelegate

    Callback to call when done.

  • Notification that Conviva no longer needs this StorageProtocol.

    Declaration

    Objective-C

    - (void)cleanUp;

    Swift

    func cleanUp()