androidchatsdk / Chat 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:StringThe Gladly SDK version. |
Functions
| Name | Summary |
|---|---|
| clearPushNotifications | fun clearPushNotifications(context:Context):UnitClear 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):UnitClear all unread messages. This resets the unread messsages count. |
| destroy | fun destroy(context:Context):UnitDestroys 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):IntGet the unread messages count. |
| handleMessageReceived | fun handleMessageReceived(context:Context, remoteMessage: RemoteMessage, suppressNotifications:Boolean= false):BooleanHandle an incoming remote message. |
| handleOnTrimMemory | fun handleOnTrimMemory(context:Context, level:Int):UnitFrees unnecessary memory/resources according to the memory trim level. This tpyically should only be used in your Application.onTrimMemory(…) call. |
| initialize | fun initialize(context:Context, settings:Settings, ei:EventInterface):UnitInitializes 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):UnitRemoves the currently signed in user and all data associated with that user. |
| openNotificationChannelSettings | fun openNotificationChannelSettings(context:Context):UnitOpens 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):UnitRegister deviceToken that will be used to send push notifications. |
| setPushNotificationConfig | fun setPushNotificationConfig(context:Context, config:NotificationConfig):UnitSet Push Notification customizations. See NotificationConfig for more details. |
| setUser | fun setUser(context:Context, user:User):UnitSets 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):UnitStarts the Gladly Chat Activity with configured settings. |
| unregisterPushToken | fun unregisterPushToken(context:Context):UnitUnregister the currently saved deviceToken used for push notifications. |