Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Go to Haptik Website
  • Contact Us
  • Home
  • Deployment
  • Android SDK

Customization on Android SDK

Written by Soham Amburle

Updated on December 13th, 2023

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Getting Started
    Build Deploy Analyse Manage Account Bot Deactivation
  • Bot Building
    Essentials Smart Skills Steps User Messages Bot Responses Entities Connections Customisations User feedback collection Testing Whatsapp Bots NLU Bot Maintenance
  • Smart Agent Chat
    Set up Admin Settings MyChats Section (Agent Inbox) Live Traffic Section Teams Section Archives Section Analytics Plans on Smart Agent Chat
  • Conversation Design
    Design Basics Design Guides Designing for Platforms Designing WhatsApp Bots
  • Developer Guides
    Code Step Integration Static Step Integration Shopify Integration SETU Integration Exotel Integration CIBIL integration Freshdesk KMS Integration PayU Integration Zendesk Guide Integration Twilio Integration Razorpay Integration LeadSquared Integration USU(Unymira) Integration Helo(VivaConnect) Integration Salesforce KMS Integration Stripe Integration PayPal Integration CleverTap Integration Fynd Integration HubSpot Integration Magento Integration WooCommerce Integration Microsoft Dynamics 365 Integration
  • Deployment
    Web SDK WhatsApp Facebook Instagram Sunshine Conversation LINE Google Business Messages Telegram MS Teams Bot as an API iOS SDK Android SDK
  • External Agent Tool Setup
    Zendesk Chat Salesforce Service Cloud Freshchat Zoho NICE CXOne Gorgias
  • Analytics & Reporting
    Intelligent Analytics
  • Notifications
    SMS Notifications Success Measurement
  • Commerce Plus
    Catalog Integration Bot Building Guide Channel Deployments Unified ML Pipeline Documentation
  • Troubleshooting Guides
    Error Messages FAQs
  • Release Notes
+ More

Table of Contents

SDK Customization Settings Launch Message CSS Customizations Update User Data

SDK Customization Settings

The SDK can be configured in a variety of ways to fit in seamlessly with the overall experience of the parent application. While initializing Haptik SDK, you pass the desired customization according to your need.

Settings:

  • primaryColor: String - The primary color used throughout the SDK.
  • tabletbgColor: String - Use this setting to change the background fill color for tablet devices.
  • enableTypingSuggestions: Boolean - Enables typing suggestions for the bot. Typing suggestions are autocompleting suggestions that show up for users when they type. This gives the user some context around the capabilities of the bot.
  • hideComposer: Boolean - Hides the composer so that the user is not given the option to type anything. This is useful when building actionable and highly directed bots.
  • noHeader: Boolean - Hides the chat window header.
  • privacyPolicyUrl: String - If GDPR is enabled, you can add a URL to your Privacy Policy page through init settings. Users will be redirected to this URL when they click on the link in the GDPR view. If not provided users will be redirected to Haptik's privacy policy page
  • initializeLanguage: String - Code of language you want to open bot with. For eg: en, hi . We support ISO_639-1 language codes.
  • composerPlaceholder: String - The placeholder text for the composer (typing area). This is the text that's shown in the typing area when it's empty.
  • customCss: String - A custom css file can be injected into the SDK, which will allow modifying the styles of the conversation screen. This parameter takes a URL path of the CSS file.
  • ignoreStorage: Boolean - If ignoreStorage is true the storage is disabled, i.e. a new user is created every time the user comes back and starts conversing with the bot. No messages/user information is stored in local storage.
  • skipSignupChatHistory: Boolean - If set to true, SDK will not fetch old chat history when an existing user performs signup again.

Example:

Kotlin Code:

val initData = InitData().apply {
    primaryColor = "#420420"
    composerPlaceholder = "Type message...."
    noHeader = true
    initializeLanguage = "en"
} 
HaptikSDK.init(applicationContext, initData)

Java Code:

InitData initData = new InitData();
initData.setPrimaryColor("#420420");
initData.setComposerPlaceholder("Type Message....");
initData.setNoHeader(true);
initData.setInitializeLanguage("en");
HaptikSDK.INSTANCE.init(this, initData);

Launch Message

You can launch the Bot with a task or message on behalf of the user. Haptik provides the following method for doing so.

Delete

Point to note: 

Call this method before calling HaptikSDK.loadGuestConversation() or HaptikSDK.loadConversation(signupData).

Kotlin Code:

HaptikSDK.setLaunchMessage("Your Message", false, false, false)

Java Code:

HaptikSDK.INSTANCE.setLaunchMessage("Hello custom sign up", false, false, false);

Params:

  • message <String> - The message that is to be sent.
  • hidden <Boolean> - Whether to send the message as a hidden user message. A hidden message is not visible to the user but can be seen by the agent or bot.
  • skipMessage <Boolean>- If set to true, the SDK will not send a launch message if the last message is a reply to a previous launch message.
  • hideWelcomeMessage<Boolean> - If set to true, the Welcome Message will not be shown when the launch message is sent.

CSS Customizations

A custom CSS file can be provided to the SDK, which will allow modifying its styles. This parameter takes a path of the CSS file hosted on a server. An example CSS is available at https://tinyurl.com/ybazgbq4 for you to get started.

Delete

Showcasing CSS classes here is out of the scope of this documentation. Please use the chrome browser's inspect element to identify which CSS classes of the SDK you need to update.

Update User Data

You can use HaptikSDK.updateUserData(userdata) method to update the user details and custom data. Make sure to call this method only after signup. Only email, mobile_no, username, and custom_data fields are allowed in the userData dictionary. 

Examples:

val customData = JSONObject().apply {
  put("order_id", 12345)
  put("date", "01/01/2022")
}

val userdata = JSONObject().apply {
  put("email", "test@email.com")
  put("mobile_no", "9898989898")
  put("username", "User Name")
  put("custom_data", customData)
}
HaptikSDK.updateUserData(userdata)

You can omit the fields which are not required to be updated.

val customData = JSONObject().apply {
  put("order_id", 12345)
  put("date", "01/01/2022")
}

val userdata = JSONObject().apply {
  put("username", "User Name")
  put("custom_data", customData)
}
HaptikSDK.updateUserData(userdata)

Was this article helpful?

Yes
No
Give feedback about this article

Related Articles

  • Push notifications on Android SDK

Platform

  • Conversation Studio
  • Smart Skills
  • Advanced NLU
  • Intelligent Analytics
  • Omnichannel
  • Smart Agent Chat
  • Enterprise Security
  • Integrations

Solutions

  • Conversational Commerce
  • Lead Generation
  • Customer Care
  • WhatsApp
  • Conversational IVR
  • Google Business Messages

Industries

  • Retail/ E-Commerce
  • Financial Services
  • Travel & Hospitality
  • Telecom

Knowledge

  • ROI Calculator
  • Reports & Research
  • Case Studies
  • Webinars
  • ISAT
  • Tech Blog
  • Business Blog
  • Resources
  • Haptik v/s Yellow
  • Haptik v/s Liveperson
  • Haptik v/s IBM Watson
  • Haptik v/s Verloop
  • Conversations on AI

Company

  • Why Haptik
  • About Us
  • Careers
  • News & Media
  • Awards & Recognition
  • Contact Us
  • Partnerships
  • Investor Relations

Subscribe

Sign up to recieve the latest updates

Find us on

  • Twitter-footer
  • Linkedin-footer
  • YT-footer
  • Insta-footer
  • G2-footer
  • Facebook-footer

Knowledge Base Software powered by Helpjuice

Copyright © jio Haptik Technology Limited 2021 | Data Security & Privacy Policy | GDPR

North America | Asia Pacific | Africa | enterprise@haptik.ai

Definition by Author

0
0