Closed samarthagarwal closed 6 months ago
Hi @samarthagarwal, thanks for choosing Amplitude. You can replace the default storage by setting config.storageProvider = YourCustomStorage()
when init. For example
class CustomStorage: StorageProvider{
override fun getStorage(amplitude: com.amplitude.core.Amplitude, prefix: String?): Storage {
TODO("Not yet implemented")
}
}
amplitude = Amplitude(
Configuration(
apiKey = AMPLITUDE_API_KEY,
context = applicationContext,
storageProvider = customStorage()
)
)
Here is the docs.
Summary
We are building a keyboard for Android and we have integrated the Amplitude Kotlin SDK in the keyboard. The keyboard service initializes when the device is turned on and the user needs to enter the password (if they have a password set up). Since the keyboard service initialized and the device is not unlocked, we get the following crash.
Is there a way to change the default storage for Amplitude? If not, are there any other solutions? As a last resort, we will have delay the SDK initialization until the device is unlocked.