-
- All Implemented Interfaces:
public final class Zendesk
Public entry point of the SDK. To use Zendesk out of the box you must call Zendesk.initialize first and once SuccessCallback is called the SDK instance will be available through Zendesk.instance.
Zendesk.initialize( context = context, channelKey = "{your-channel-key}", successCallback = { // The initialization was successful }, failureCallback = { cause -> // The initialization failed and "cause" is an optional "ZendeskError" } )
After Zendesk.initialize completes successfully, calling Zendesk.instance will return an instance of Zendesk which you can use to perform SDK actions such as showing the conversation screen.
Zendesk.instance.messaging.showMessaging(context)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
Zendesk.Companion
-
Method Summary
Modifier and Type Method Description final Messaging
getMessaging()
final Unit
addEventListener(ZendeskEventListener listener)
Adds an instance of ZendeskEventListener to listen to all events emitted by the SDK. final Unit
removeEventListener(ZendeskEventListener listener)
Removes the given instance of ZendeskEventListener from the current listeners. final Unit
loginUser(String jwt, SuccessCallback<ZendeskUser> successCallback, FailureCallback<Throwable> failureCallback)
Authenticate a user. final Unit
logoutUser(SuccessCallback<Unit> successCallback, FailureCallback<Throwable> failureCallback)
Unauthenticate a user. final Unit
sendPageView(PageView pageView, SuccessCallback<Unit> successCallback, FailureCallback<Throwable> failureCallback)
Sends an event to the page view events API. -
-
Method Detail
-
getMessaging
final Messaging getMessaging()
-
addEventListener
final Unit addEventListener(ZendeskEventListener listener)
Adds an instance of ZendeskEventListener to listen to all events emitted by the SDK.
This method is safe for concurrent use.
- Parameters:
listener
- an instance of ZendeskEventListener to add
-
removeEventListener
final Unit removeEventListener(ZendeskEventListener listener)
Removes the given instance of ZendeskEventListener from the current listeners.
This method is safe for concurrent use.
- Parameters:
listener
- the instance of ZendeskEventListener to remove
-
loginUser
final Unit loginUser(String jwt, SuccessCallback<ZendeskUser> successCallback, FailureCallback<Throwable> failureCallback)
Authenticate a user.
- Parameters:
jwt
- The jwt belonging to the user.successCallback
- an implementation of SuccessCallback to be notified of a authentication resultfailureCallback
- an implementation of FailureCallback to be notified of a failure
-
logoutUser
final Unit logoutUser(SuccessCallback<Unit> successCallback, FailureCallback<Throwable> failureCallback)
Unauthenticate a user.
- Parameters:
successCallback
- an implementation of SuccessCallback to be notified of a un-authentication was successfulfailureCallback
- an implementation of FailureCallback to be notified of a failure
-
sendPageView
final Unit sendPageView(PageView pageView, SuccessCallback<Unit> successCallback, FailureCallback<Throwable> failureCallback)
Sends an event to the page view events API.
- Parameters:
pageView
- the page view event to sendsuccessCallback
- an implementation of SuccessCallback to be notified of a successful resultfailureCallback
- an implementation of FailureCallback to be notified of a failure
-
-
-
-