//sorisdk/com.iplateia.sorisdk/IMetadataProvider
IMetadataProvider
[androidJvm]
interface IMetadataProvider
Interface for delegate the metadata to be sent to the server. You can implement this interface to what metadata you want to send to the server. The metadata which is sent to the server will be passed through the webhook.
It is useful when you want to identify the user who is successfully authenticated or recognized audio. Each time SORIAudioRecognizer authorized successfully, founds a campaign, and user clicks on it, the metadata will be passed to the webhook URL.
Please note that, the metadata that sent to the server will never be stored or used for any other purpose.
example implementation:
kotlin
class CustomMetadataProvider : IMetadataProvider {
override fun getMetadata(): Map<String, String> {
// TODO: get metadatq from the app user
return mapOf(
"user" to "user123",
"ageGroup" to "21-30",
"gender" to "female",
)
}
}
// setup the metadata provider
SORIAUdiodioRecognizer.metadataProvider = CustomMetadataProvider()
val sori = SORIAUdiodioRecognizer("your_app_id", "your_secret_key")
sori.startRecognition(this)
Functions
Name | Summary |
---|---|
getMetadata | [androidJvm] abstract fun getMetadata(): Map<String, String> |