Interface IMetadataProvider

  • All Implemented Interfaces:

    
    public 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:

    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)
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract Map<String, String> getMetadata()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait