​Zoho Assist Callbacks
Use the SDK callbacks methods in the ISessionCallbacks class to override these methods to suit your app.
class ISessionCallbacks(private val activity: Activity, private val binding: ActivityMainBinding) :
SessionCallbacks {
/**
* Callback used to perform any operation using the response gotten from validating the token and session key.
*/
override fun onValidationResponse(response: String, responseCode: AssistSession.ApiResponse) {
Toast.makeText(activity, response, Toast.LENGTH_SHORT).show()
when (responseCode) {
AssistSession.ApiResponse.SUCCESS -> {
}
AssistSession.ApiResponse.ERROR -> {
}
}
}
/**
* Callback used to handle why the session failed scenario cases
*/
override fun onSessionStartFailed(failure: SessionStartFailure) {
when (failure) {
SessionStartFailure.BELOW_MIN_API_LEVEL -> {}
SessionStartFailure.CONTEXT_NOT_AVAILABLE -> {}
SessionStartFailure.INVALID_SDK_TOKEN -> {}
SessionStartFailure.INVALID_SESSION_KEY -> {}
SessionStartFailure.POST_NOTIFICATION_PERMISSION_DENIED -> {}
else -> {}
}
}
/**
* Called when AddOn is available for the device via playstore.
* Can be used by the customer to install the plugin from their own sources if necessary.
*/
override fun onAddOnAvailableForDownload() {
}
/**
* Callback used to handle the received messages.
*/
override fun onMessageReceived(model: ChatModel) {
}
/**
* Callback used to handle UI changes for role change request.
*/
override fun onRoleChangeRequest() {
}
/**
* Callback used to handle screenshare request
*/
override fun onScreenShareRequest() {
}
/**
* Callback used to perform any operation when session ends.
*/
override fun onSessionEnded() {
}
/**
* Callback used to perform any operation when session starts.
*/
override fun onSessionStarted() {
}
/**
* Called when screen share is started, and can be used in conjunction
* with `startRemoteControlOnStart(false)` to prompt user for remote control permission
*/
override fun onScreenShareStarted() {
// AssistSession.INSTANCE.startAddon()
}
/**
* Called when participant status changes
*/
override fun onParticipantStateChange(
participantState: ParticipantState,
participantName: String
) {
}