Conversation Status
To get the currentASAPPConversationStatus
, implement the conversationStatusHandler
callback:
- If
isLiveChat
istrue
, the customer is currently connected to a live support agent or in a queue. - The
unreadMessages
integer indicates the number of new messages received since last entering Chat.
Trigger the Conversation Status Handler
You can trigger this handler in two ways:- Manually trigger it with:
conversationStatusHandler
once it is available.
- The handler may be triggered when a push notification is received if the application is in the foreground. If your application handles Firebase push notifications, use:
The Chat SDK only looks for conversation status data in the payload and doesn’t cache or persist analytics. If the push notification was sent from ASAPP, the SDK returns true and triggers the
conversationStatusHandler
callback.Debug Logs
By default, the SDK only prints error logs to the console output. To allow the SDK to log warnings and debug information, usesetDebugLoggingEnabled
.
Disable debug logs for production use.
Clear the Persisted Session
To clear the ASAPP session persisted on disk:Only use this when an identified user signs out. Don’t use for anonymous users, as it will cause chat history loss.
Setting an Intent
Open Chat with an Initial Intent
ASAPP.instance.setASAPPIntent()
. Only call this if chat is already open. Use ASAPP.instance.doesASAPPActivityExist
to verify if the user is in chat.
Handling Chat Events
Implement theASAPPChatEventHandler
interface to react to specific chat events:
These events relate to user flows inside chat, not user behavior like button clicks.
Implement Chat end
To track the end of a chat, implement the following customCHAT_CLOSED
event
In this example, the event message is set as
Chat is closed
. But you can name it as you wish.Chat end implementation is available for the SDK version 10.3.1 and above.
Send
This API is primarily used to send information that is used to show a proactive chat prompt when a specific criteria or set of criteria are met. To use this API:- Specify a
type
ofcustomer
Only thecustomer
event type is supported. - Provide a
data
object containing thecustomerInfo
object: