androidchatsdk / Sidekick Android SDK / Gladly

Gladly

object Gladly

Gladly is a singleton instance which exposes an API which will allow an app to embed Gladly chat and configure it’s behaviour.

Properties

Name Summary
version const val version:String
The Gladly SDK version.

Functions

Name Summary
clearPushNotifications fun clearPushNotifications(context:Context):Unit
Clear all gladly chat push notifications. Useful when re-entering your application and it makes sense to clear all push notifications.
clearUnreadMessages fun clearUnreadMessages(context:Context):Unit
Clear all unread messages. This resets the unread messsages count.
destroy fun destroy(context:Context):Unit
Destroys the Gladly instance and frees up any memory it allocated. In order to use Gladly again, you must call initialize().
getUnreadCount fun getUnreadCount(context:Context):Int
Get the unread messages count.
handleMessageReceived fun handleMessageReceived(context:Context, remoteMessage: RemoteMessage, suppressNotifications:Boolean= false):Boolean
Handle an incoming remote message.
initialize fun initialize(context:Context, settings:Settings, ei:EventInterface):Unit
Initializes Gladly, this must be called before any other function is called. This should be called in your application’s onCreate. Note that this should be at the Application level. This is so the SDK can properly use your EventInterface even when started from a Push Notification.
logout fun logout(context:Context):Unit
Removes the currently signed in user and all data associated with that user.
openNotificationChannelSettings fun openNotificationChannelSettings(context:Context):Unit
Opens the notification channel settings. Note that this will only occur for Android O+ (because Channels don’t exist below Android O!).
registerPushToken fun registerPushToken(context:Context, deviceToken:String):Unit
Register deviceToken that will be used to send push notifications.
setPushNotificationConfig fun setPushNotificationConfig(config:NotificationConfig):Unit
Set Push Notification customizations. See NotificationConfig for more details.
setUser fun setUser(context:Context, user:User):Unit
Sets the current user that will be logged in when communicating with Gladly. If this is set the user does not have to provide email and name.
showChat fun showChat(context:Context):Unit
Starts the Gladly Chat Activity with configured settings.
unregisterPushToken fun unregisterPushToken(context:Context):Unit
Unregister the currently saved deviceToken used for push notifications.