Skip to content

//sorisdk/com.iplateia.sorisdk

Package-level declarations

Types

NameSummary
Actions[androidJvm]
object Actions
Constants for the action names in broadcast intents.
APIConfig[androidJvm]
object APIConfig
Represents the configuration for the SORI API. Since SORIAudioRecognizer is considered a singleton, the configuration is stored in this object.
AuthResult[androidJvm]
data class AuthResult(val success: Boolean, val updated: Boolean, val url: String?)
Represents the result of an authentication process.
ILocationProvider[androidJvm]
interface ILocationProvider
Interface for delegate the location to be sent to the server. The location can be used to narrow down the campaign to a specific location.
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.
ISORIListener[androidJvm]
interface ISORIListener
Interface definition for a callback to be invoked when SORI events occur. Implement this interface to receive notifications about service readiness, errors, and detected campaigns.
ServiceState[androidJvm]
object ServiceState
Constants for the service states.
SORIApiClient[androidJvm]
open class SORIApiClient(applicationId: String, secretKey: String, sessionId: String)
SORIAudioRecognitionService[androidJvm]
open class SORIAudioRecognitionService : Service
SORIAudioRecognitionService is a service that handles audio recognition tasks. It runs in the foreground and provides notifications to the user.
SORIAudioRecognizer[androidJvm]
open class SORIAudioRecognizer(applicationId: String, secretKey: String)
The primary entry point for the SORI SDK that handles the audio recognition tasks.
SORIBroadcastReceiver[androidJvm]
class SORIBroadcastReceiver(listener: ISORIListener) : BroadcastReceiver
Default BroadcastReceiver for SORIAudioRecognitionService. It listens to the broadcast intents sent by the service and fires the corresponding events to the listener.
SORICampaign[androidJvm]
data class SORICampaign(val id: String, val name: String, val description: String? = null, val imageUrl: String? = null, val actionUrl: String? = null, val createdAt: Long = 0) : Parcelable
Represents a SORI campaign that found during the audio recognition process.
SORIListener[androidJvm]
open class SORIListener : ISORIListener
Default implementation of the ISORIListener interface. You can extend this class to override specific methods as needed.

Properties

NameSummary
API_ENDPOINT[androidJvm]
const val API_ENDPOINT: String
API base endpoint
DUMP_PCM[androidJvm]
const val DUMP_PCM: Boolean = false
Dump PCM data flag
TAG[androidJvm]
const val TAG: String
Log tag for the SDK
VERSION[androidJvm]
const val VERSION: String
SDK version

Functions

NameSummary
getDeviceId[androidJvm]
fun getDeviceId(context: Context): String
Create or retrive the device ID from shared preferences. If it doesn't exist, it generates a new UUID and saves it.
getPreference[androidJvm]
fun getPreference(context: Context, key: String): String?
Retrieve a string preference from shared preferences.
[androidJvm]
fun getPreference(context: Context, key: String, defaultValue: String): String
Retrieve a string preference from shared preferences with a default value.
setDeviceId[androidJvm]
fun setDeviceId(context: Context, deviceId: String)
Set the device ID manually in shared preferences.
setPreference[androidJvm]
fun setPreference(context: Context, key: String, value: Objects)
Save an object preference in shared preferences. The value should be serializable using Kotlin serialization.
[androidJvm]
fun setPreference(context: Context, key: String, value: String)
Save a string preference in shared preferences.