Basics¶
Once you've added the MimiSDK dependency, there are a few basics to explain before you can fully utilize the features and capabilities.
Client Authentication¶
We use a client credentials to authenticate you as a partner product with Mimi. These credentials are mandatory, and the SDK will not function without providing them.
So before continuing, make sure you have the following:
- Client Identifier
- Client Secret
Call MimiCore.start()
in your Application
class to initialize the SDK.
Note
MimiSDK initialization should only be performed once during the lifecycle of your app. We recommend that you initialize the SDK in your Application
class.
class MyApp: Application() {
override fun onCreate() {
super.onCreate()
MimiCore.start(this,
"MY_CLIENT_ID",
"MY_CLIENT_SECRET")
}
}
Warning
If you have been supplied with dev and production credentials: please ensure that these credentials are used only for their corresponding app build variant. Dev credentials should only be used for development builds, and production credentials should be used for release builds.
Extra permissions¶
Make sure your App's manifest includes the internet permissions, otherwise you won't be able to initialize our services. As of v3.6.0
, we also require access to the device's microphone as some of our test paradigms require monitoring the environment noise level:
Also we use internally for our network requests OkHttp. This library requires that you enable Java 8 in your builds to function properly. If you have not done so yet, then you will just need to add this snippet to your build.gradle
:
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
Mimi Events¶
MimiEvents
interface contains a number of functions that any client app using MimiSDK must conform and respond to.
Required Update¶
In exceptional circumstances, we might need to deprecate and mark older versions of the SDK as unsupported. These decisions will be well communicated far in advance of the notification by our team. However, if a user of your app is using an unsupported version of the MimiSDK or your app, you should respond appropriately to ensure that they have a pleasant upgrade experience.
If you receive a call to the mimiRequiresUpdate()
function, you should expect that all functionality of the MimiSDK is now unavailable. We recommend that you display an AlertDialog
to your users informing them that they need to update the app to the latest available version which has a newer version of MimiSDK integrated.
override fun mimiRequiresUpdate(errorMsg: String?) {
lifecycleScope.launch(Dispatchers.Main) {
AlertDialog.Builder(this@MyActivity, R.style.MyStyle).apply {
setTitle(R.string.sdk_needs_update_title)
setMessage(R.string.sdk_needs_update_msg)
setPositiveButton(R.string.generic_ok, null)
}.show()
}
}
MimiSDK is now set up and ready to go.
Next Steps¶
With everything set up, you can now move for example onto crafting your Mimi Profile.