Setting up the SDK
First steps before working with the SDK
Install the Kape Client SDK
Configure and Initialize
1
Implementing Callback Interfaces
StorageCallbackProtocol
public protocol StorageCallbackProtocol : AnyObject {
func storeData(storageId: String, data: Data) throws
func retrieveData(storageId: String) throws -> Data?
}interface StorageCallbackProtocol {
fun storeData(storageId: String, data: ByteArray)
fun retrieveData(storageId: String): ByteArray?
}Parameter
Description
LogCallbackProtocol
public protocol LogCallbackProtocol : AnyObject {
func log(
logLevel: CallbackLogLevel,
category: String,
file: String,
line: UInt32,
message: String
) throws
}interface LogCallbackProtocol {
@Throws(Exception::class)
fun log(
logLevel: CallbackLogLevel,
category: String,
file: String,
line: UInt,
message: String
)
}Parameter
Description
StateCallbackProtocol
2
Creating the Base Configuration
ClientDetails
Property
Description
Cache File Path
let configuration = Configuration()
configuration.setClientDetails(details: clientDetails)
// This might throw an exception in case the path is invalid or not writable
try configuration.setCacheFilePath(cacheFilePath: <Path>)
// Activate the SDK License
try configuration.setLicense(
license: "Content of the License File we provided to you"
)
// Register the Callbacks
configuration.setStorageCallback(callback: StorageClient())
configuration.setLogCallback(callback: LogClient())
val configuration = Configuration()
configuration.setClientDetails(clientDetails)
// This might throw an exception in case the path is invalid or not writable
configuration.setCacheFilePath(cacheFilePath: <Path>)
// Activate the SDK License
configuration.setLicense("Content of the License File we provided to you")
// Register the Callbacks
configuration.setStorageCallback(StorageClient())
configuration.setLogCallback(LogClient())3
4
Last updated