I am integrating the Mesibo Android SDK (version 2.7.19) into my Kotlin application. I need to implement the Mesibo.MessageListener interface to receive real-time messages, but I am facing a compilation error where Mesibo.MessageParams cannot be resolved.
Dependencies:
kotlin
implementation("com.mesibo.api:mesibo:2.7.19")
Code:
kotlin
import com.mesibo.api.Mesibo
// import com.mesibo.api.Mesibo.MessageParams // Fails: Unresolved reference
class MyActivity : AppCompatActivity(), Mesibo.MessageListener {
// Compilation Error: Unresolved reference: MessageParams
override fun Mesibo_onMessage(params: Mesibo.MessageParams?, data: ByteArray?): Boolean {
val message = String(data ?: ByteArray(0))
Log.d("Mesibo", "Received: $message")
return true
}
override fun Mesibo_onMessageStatus(params: Mesibo.MessageParams?) {}
override fun Mesibo_onActivity(params: Mesibo.MessageParams?, activity: Int) {}
override fun Mesibo_onLocation(params: Mesibo.MessageParams?, location: Mesibo.Location?) {}
override fun Mesibo_onFile(params: Mesibo.MessageParams?, file: Mesibo.FileInfo?) {}
}
What I've Tried:
Explicit Imports: Tried importing
-
com.mesibo.api.Mesibo.MessageParams but the compiler says "Unresolved reference". Java Implementation: I created a Java test class to implement the interface. The compiler error suggested I was missing Mesibo_onMessageUpdate(MesiboMessage), implying the type is MesiboMessage. However, I cannot find or import com.mesibo.api.MesiboMessage.
Downgrading: Tried version 2.5.0 but faced similar resolution issues.
Question: What is the correct parameter type for Mesibo_onMessage
in Mesibo SDK 2.7.19 for Kotlin? Is MessageParams deprecated or moved to a different package?