
com.amplitude.id.IMIdentityStorage.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of analytics-core Show documentation
Show all versions of analytics-core Show documentation
Amplitude Kotlin Core library
The newest version!
package com.amplitude.id
/**
* In Memory Identity Storage
*/
class IMIdentityStorage : IdentityStorage {
var userId: String? = null
var deviceId: String? = null
override fun load(): Identity {
return Identity(userId, deviceId)
}
override fun saveUserId(userId: String?) {
this.userId = userId
}
override fun saveDeviceId(deviceId: String?) {
this.deviceId = deviceId
}
override fun delete() {
userId = null
deviceId = null
}
}
/**
* In Memory Identity Storage Provider
*/
class IMIdentityStorageProvider : IdentityStorageProvider {
override fun getIdentityStorage(configuration: IdentityConfiguration): IdentityStorage {
return IMIdentityStorage()
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy