ASAPP

@Singleton
class ASAPP

ASAPP SDK main interface, used to configure, customize and start ASAPP Chats.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The ASAPPChatEventHandler interface, called when certain agreed-upon events occur during chat.

Link copied to clipboard

The current ASAPPConfig being used by ASAPP. Note: Please avoid setting this variable on production use, as it may create unnecessary session clearing and API calls. Instead, call init with the desired configuration.

Link copied to clipboard

The ASAPPConversationStatusHandler handler, called when the the ASAPP SDK receives an ASAPP push notification. If your application already handles push notifications, please use ASAPP.onFirebaseMessageReceived so that the SDK can handle incoming ASAPP notifications.

Link copied to clipboard

The ASAPPDeepLinkHandler instance, called when the user taps on an ASAPP Chat deep link.

Link copied to clipboard

Helper method that checks if the currently displaying Activity is from ASAPP SDK.

Link copied to clipboard
var theme: Int

The theme resource id that will be used for all ASAPP activities.

Link copied to clipboard

Used for development and debugging only.

Link copied to clipboard

The current ASAPPUser being used by ASAPP.

Link copied to clipboard

The ASAPPUserLoginHandler instance, called when the user needs to log in again.

Link copied to clipboard

The ASAPPUserLoginResultHandler instance, called when the user needs to log in again.

Link copied to clipboard

The ASAPPWebLinkHandler instance, called when the user taps on a web link. This is only needed if host app requires custom handling of web links.

Functions

Link copied to clipboard

Clears the current ASAPP session. This also includes any cached messages.

Link copied to clipboard

Disables Push Notifications for the current ASAPP.user and device.

Link copied to clipboard

Makes an async request to get the current ASAPPConversationStatus. The resulting status is notified back via conversationStatusHandler. If that handler isn't set, calling this function will have no effect.

Link copied to clipboard

Makes an async request to get the current ASAPPConversationStatus.

Link copied to clipboard

DEPRECATED. Please use ASAPP.conversationStatusHandler instead. For more details, please see https://docs.asapp.com/en/integration/android-sdk/push-notifications.html

Link copied to clipboard

Returns the current ASAPPStyleConfig.

Link copied to clipboard
fun onFirebaseMessageReceived(message: RemoteMessage): Boolean

Processes an incoming push notification message from Firebase. If this message came from ASAPP ASAPP.conversationStatusHandler will be triggered.

Link copied to clipboard
fun openChat(context: Context, androidIntentExtras: Bundle? = null, asappIntent: Map<String, Any>? = null)

The entry point to the Chat experience.

Link copied to clipboard
fun openComponentViewDebug(context: Context, templateJsonString: String)

For debug use only.

Link copied to clipboard
fun setASAPPIntent(asappIntent: Map<String, Any>)

Sets the intent on the current ASAPP Chat Activity.

Link copied to clipboard

Enable/disable logging. NOTE: You should not allow debug logs for production builds, to avoid having sensitive logs available in release builds. This allows Debug and Warning logs to be printed to console, while Error level logs will always be printed.

Link copied to clipboard
fun shouldOpenChat(intent: Intent): Boolean

Tells whether this Intent was received with the purpose of opening the ASAPP chat.

Link copied to clipboard

Updates the Push Notification Token used for the current ASAPP.user and device, with the given token. The new token will be used by ASAPP's Backend to send Push Notifications to the current user+device, via the desired Push Notification channel as defined during integration.