Use the HubSpot mobile chat SDK to integrate your Android mobile application with HubSpot’s live chat functionality.
google-services.json
in the app/
folder, and ensure that the package_name
field in the file is set to com.example.demo
.hubspot-info.json
file in the app/
folder. The full path of the file should be app/src/main/assets/hubspot-info.json
.HubSpotManager
class, then call the configure
method
HubspotConfigError
class represents different errors when missing properties.
HubspotWebActivity
which extends the Activity
class. You can open it by using any of the following approaches:
startActivity
via intentonClick
listener of that button, open the HubspotWebActivity
.HubspotFloatingActionButton
in the file which handle the clicks and open the HubspotWebActivity
automatically.onClick
listener of a button:
HubspotManager.setUserIdentity(email, identityToken)
. This should be called before opening a chat view.
HubspotManager.setChatProperties(key, value)
method and provide the associated key and value you want to set. This is best called before starting a chat, and will apply to all new chats. You could set an account status, or other identifiers when setting up your user. These will then appear in all chats opened for the remainder of the app launch.
For example, the following code would set permissions for camera, photo, notifications, and location data to "false"
.
HubspotManager.logout()
at an appropriate time in in your app.