Beacon

class Beacon

Types

Link copied to clipboard
class Builder
A builder class used to configure and set up your Beacon instance.

Functions

Link copied to clipboard
open fun addAttributeWithKey(@NotNull key: @NotNull String, @NotNull value: @NotNull String): Boolean
Adds a user attribute represented as a key/value pair.
Link copied to clipboard
open fun addPreFilledForm(preFilledForm: PreFilledForm)
Allows pre-filling of the contact form with specified data.
Link copied to clipboard
open fun beaconId(): String
Returns the ID of this Beacon.
Link copied to clipboard
open fun chatEnabled(): Boolean
Checks if the Realtime chat feature is enabled for this Beacon.
Link copied to clipboard
open fun clear()
Performs a complete reset of the Beacon SDK, clearing all persisted data and state.
Link copied to clipboard
open fun clearAttributes()
Removes all user attributes associated with the current user.
Link copied to clipboard
open fun contactFormReset()
Resets the contact form by clearing all of its fields, custom fields, and attachments.
Link copied to clipboard
open fun docsEnabled(): Boolean
Checks if the Docs feature is enabled for this Beacon.
Link copied to clipboard
open fun email(): String
Returns the email address used to identify the user.
Link copied to clipboard
@NotNull
open fun getSessionAttributes(): @NotNull Map<String, String>
Retrieves the current session attributes.
Link copied to clipboard
open fun identify(@NotNull email: @NotNull String)
Identifies a user for the Beacon, primarily when Beacon is configured for normal mode.
open fun identify(@NotNull email: @NotNull String, @Nullable name: String)
Identifies a user with an email and name, primarily when Beacon is configured for normal mode.
open fun identify(@NotNull email: @NotNull String, @Nullable name: String, @Nullable company: String, @Nullable jobTitle: String, @Nullable avatar: String)
Used to identify users plus adds support for special attributes.
Link copied to clipboard
open fun isEnabled(): Boolean
Checks if Beacon is currently enabled.
Link copied to clipboard
open fun logout()
open fun logout(endActiveChat: Boolean)
Clears the current user's session and identity data.
Link copied to clipboard
open fun logsEnabled(): Boolean
Enables application logging to Logcat for debugging purposes only.
Link copied to clipboard
Checks if the Messaging/contact form feature is enabled for this Beacon.
Link copied to clipboard
Checks if previous messages are enabled for this Beacon.
Link copied to clipboard
open fun removeAttribute(@NotNull key: @NotNull String): Boolean
Removes a specific user attribute.
Link copied to clipboard
Clears any previously set overrides for suggested articles or links.
Link copied to clipboard
open fun setConfigOverrides(@NotNull configOverrides: @NotNull BeaconConfigOverrides)
Overrides the configuration from the Beacon Builder, which is defined on the Help Scout Beacon admin page.
Link copied to clipboard
open fun setFirebaseCloudMessagingToken(@NotNull context: @NotNull Context, token: String)
Stores the Firebase Cloud Messaging token for push notifications.
Link copied to clipboard
open fun setOverrideChatEnabled(overrideChatEnabled: Boolean)
Overrides and disables the Beacon Builder real-time chat option.
Link copied to clipboard
open fun setOverrideDocsEnabled(overrideDocsEnabled: Boolean)
Overrides and disables the Beacon Builder Articles/Docs option.
Link copied to clipboard
open fun setOverrideMessagingEnabled(messagingEnabled: Boolean)
Overrides and disables the Beacon Builder Messaging/Contact form option.
Link copied to clipboard
Overrides the suggested articles displayed on the Help & Support screen.
Link copied to clipboard
Overrides the suggested articles or links displayed on the Help & Support screen.
Link copied to clipboard
open fun setSessionAttributes(@NotNull sessionAttributes: @NotNull Map<String, String>): Boolean
Adds session attributes to the next chat or conversation sent via the Beacon SDK.
Link copied to clipboard
Controls whether users of the contact form can see and edit custom field values when they are pre-filled.
Link copied to clipboard
open fun userHasEmail(): Boolean
Checks if an email address has been defined for the current user.
Link copied to clipboard
open fun version(): String
Returns the current version of the Beacon SDK.