LogoLogo
Click Here For More Support
  • 📍Get Started
    • Welcome
    • Who We Are
    • Our Product
  • 🤖AI Agent Engine
    • AI Agent Engine Basics
      • Get to Know Your AI Agent Engine
      • Glossary
      • Dashboard Overview
    • Manage Your Content
      • Response Types
        • Prewritten Plus Responses
          • Add New Prewritten Responses
          • Edit Prewritten Responses
          • Enrich Prewritten Responses
          • Response Refiner
        • Generated Responses
          • Web-Scraped Data
            • Troubleshooting
          • Documented Data
          • Enrich Generated Responses
        • Fallback Responses
      • Enrichments
        • Buttons
        • Quick Replies
        • Videos
        • Images & GIFs
          • Best Practices
      • Input Director
        • Copy & Paste Input Training
      • Best Practices
        • Locate Responses/Data
        • Revise Responses
        • Unpublish Responses
        • Content Formatting
        • Suppress Thumbs Up/Down
        • Content Groups
      • Upgrade to Context LLM
    • Install Your Chat
      • Web Installation
        • Advanced Pop-Up Options
      • InApp Webview Installation
        • App Provider Product Overview
        • iOS Advanced Install Guide
        • Android Advanced Install Guide
        • Passing Customer Identifiers
    • Enhance the Chat Experience
      • Pages
        • Add/View Chat Pages
        • Maintain State
        • Avatars
        • Chat Header Image
        • Input Container
        • Chat Background
      • Popups
        • Editor Field Definitions
        • Add/Edit Popups
        • Auto-Open
        • Prompt Bubble
        • Popup Button Image
        • Best Practices
      • Page Themes
        • Field Definitions
        • Adjust Page Themes
      • Activation & Drivers
        • Embed Webpages
        • Link Other Chats
        • Welcome Messages
      • Placement
        • Digital Placement
          • Chat Tile
          • Chat in Chat
        • In-Person Placement
      • Sponsor Inclusion
    • Features & Integrations
      • Channels
        • Facebook Messenger
          • Maintenance & Best Practices
        • Inbound SMS
      • Integrations
        • Ticket Commerce
          • Installation/Maintenance
          • Best Practices
        • Simpleview Integration
          • Listings
          • Events
          • Search Logic Summary
        • Zapier
          • Installation Guide
            • Connect to Salesforce
            • Connect to Google Sheets
        • FEVO
          • Installation Guide
          • Best Practices
        • Carbonhouse Integration
      • Features
        • Multi-Language Functionality
        • Mobile Ticketing Guide
        • Food & Beverage Finder
          • Installation/Maintenance
          • Best Practices
        • Weather Feature
        • Consent Form Feature
        • Satisfaction Score
        • 'Notify Subscription' Feature
    • User Management
      • User Types
      • Adjust User Type & Access
      • Add/Remove a User
      • Update Your Password
      • Unlock Your Account
      • Multi-Factor Authentication
    • Reporting & Analytics
      • Analytics Dashboard
        • Overview
        • AI Chat Performance Dashboard
        • Intent Explorer Dashboard
        • Intent Trends Dashboard
        • Intent Deep-Dive Dashboard
        • Bridge Agent Performance Dashboard
        • Mobile Ticketing Guide Dashboard
      • Data Reports
        • Conversation Transcripts
        • AI Resolutions Log
        • URL Link-Outs
        • Bridge Escalations
        • CSAT Entries
        • Ticket Commerce Records
        • End User Contacts
        • NLP Traffic Log
        • Input and Response Log
        • List URL Subscriptions
        • Get Response Feedback
        • Knowtifi Subscriptions
      • API Report Options
      • External IDs
      • UTM Tracking
      • Security Alerts
  • 📬Marketing Engine
    • Marketing Engine Basics
      • Get to Know Your Marketing Engine
      • Glossary
      • Login to Your Account
    • Marketing Calendar
      • How to Use the Marketing Calendar
    • Segments
      • Segments Overview
      • Uploading Contacts Manually
      • Uploading Contacts in Bulk
      • Importing a File into Unsubscribe List
      • Manage Contact Lists
      • Create Custom Object & Custom Fields for Contact Data Management
      • Contact Engagement Rules
      • Folders
      • Audience
        • Audience Dashboard
        • Audience Filters/Segments
        • Create a Meta Audience
        • Create a Audience Using Marketing Engine
      • Best Practices
        • Use Send Time Optimization
    • Templates & Landing Pages
      • Email Templates
        • Create & Preview an Email Template with Dynamic Content
      • SMS/MMS Template
      • WhatsApp Template
        • WhatsApp Carousel Template
        • WhatsApp LTO Template
        • WhatsApp Product Message Templates
      • Webpush Template
      • Mobilepush Template
      • Landing Page Template with a Form
      • Social Conversation Templates
    • Campaigns
      • Messaging Campaigns
        • Select Your SMS/MMS Sender Number
        • How to Create an SMS/MMS Campaign
        • Enable Double Opt-In
        • Messaging Campaign Report
        • Best Practices
        • SMS Regulations
          • SMS Regulations for India
          • SMS Regulations for Canada
          • SMS/MMS Regulations for USA
      • Social Campaigns
      • Email Campaigns
        • Create an Email Campaign
        • Update an Email Campaign
        • Email Campaign Report
        • Smart AI Tools
        • Best Practices
          • Reduce SPAM rate in emails
          • Craft Compelling Email Pre-Header Text
    • Journeys
      • Overview
      • Journey Blocks
      • Journey Templates
      • Create a Journey
      • Variant Testing
      • Conversion Tracking
      • Campaign or Journey Metadata
      • Advanced Filters for Sorting Campaigns/ Journeys
      • WhatsApp Journey
        • How to Use WhatsApp for Commerce
        • How to Send a WhatsApp One-Way Notification
        • Send a WhatsApp Audio Message
        • Automated WhatsApp Welcome Journey
        • WhatsApp Journey Report
      • Best Practices
        • Email Journey Strategy for Ticket Buyers
        • Journey Examples
    • Settings & Integrations
      • Integrations
        • Ticketing Integrations
          • Ticketmaster Integration
            • Best Practices
          • SeatGeek Integration
          • Glitnir Ticketing Integration
        • E-Commerce Integrations
          • Shopify
        • Website Tracking
          • Track Your Website
          • JavaScript Tracking Client
          • Track WordPress Websites
          • Track Shopify Stores
          • Enable User ID Tracking
        • Zapier Integration
      • User Management
        • Account Types
        • Add/Remove a User
        • Adjust Role & Access
        • Update Your Password
        • Two-Factor Authentication
      • Settings
        • Add Email Sender Addresses to Launch Campaigns
        • Connect Your Email Domain with the Marketing Engine
        • Connect Your Social Accounts
        • Connect your Shopify Store
        • Integrate Webpush Notifications
        • Setup Segment-based Engagement Rules
    • Factcubes
      • Fan Maturity Model
  • 💬Live Agent Engine
    • Get to Know Your Live Agent Engine
    • System Configuration
      • Installation Guide
      • Escalation Schedule
      • Multiple Team Involvement
      • Leave a Message & Contact Collection
      • Conversation Labels
      • Additional Channels & Placement
        • Bridge Placement
        • Bridge Email
          • Installation Guide
        • Facebook Messenger
    • Agent Overview
      • Logging In
      • Dashboard Overview
      • Profile Setup
      • Notification Preferences
      • Set Your Availability
      • Conversation Status
      • Assign a Conversation
      • Reply in a Conversation
      • Canned Responses
        • Add/Use a Canned Response
        • Modify/Delete a Canned Response
        • Best Practices
      • Participate in a Conversation
      • Private Notes & Mentions
      • Mute/Block a User
      • Prioritize Conversations
      • Resolve a Conversation
      • Export Transcripts
      • Macros/Automation
      • Keyboard Shortcuts
      • Ending Your Shift
      • Troubleshooting
    • Admin Overview
      • Adjust Team Assignments
      • Update Agent Status
      • Additional System Controls
    • Data & Reporting (Bridge)
    • Bridge Mobile App
  • SYSTEM UPDATES & SUPPORT
    • Help Center
    • Release Notes
      • Archived Product Updates
Powered by GitBook
On this page
  • Purpose of this document
  • Prerequisites
  • Dependencies
  • Integration Steps
  • Integrating WebView Classes
  • Sample Code For Background Execution
  • Additional Recommendations

Was this helpful?

Last updated 1 year ago

Was this helpful?

Purpose of this document

This document will serve as a guide to integrate a Satisfi Labs webview chat page into your Android application. Along with this document, Satisfi Labs also provides a fully working sample Android application with code available for download.

The test application can be downloaded from the google play store:

The associated codebase can be downloaded from here:

For an instance of a web chat URL, you can use the URL provided to you by your Satisfi Labs Customer success representative or you can use the following sample Url:

Prerequisites

Min Deployment Target: API Level 21

IDE: Android Studio Third Party

Libraries: None

Dependencies

The minimum dependencies should involved in this project are,

dependencies { 
implementation 'androidx.appcompat:appcompat:1.2.0' 
implementation 'androidx.constraintlayout:constraintlayout:2.0.4' 
}

These dependencies should be included in:

Gradle Scripts > build.gradle (Module: yourApp)

(These dependencies may already exist in your project.)

Integration Steps

  1. Install the latest version Android studio

  2. Create New Project or open Existing Project

  3. If new project is opened then,

    1. In the Select a Project Template window, select Empty Activity and click Next.

    2. In the Configure your project window, complete the following:

      1. Enter "Your App Name" in the Name field.

      2. Enter "com.example.yourappname" in the Package name field.

      3. If you'd like to place the project in a different folder, change its Save location.

      4. Select Java from the Language drop-down menu.

      5. Select the API 21: Android 5.0 (Lollipop) version of Android your app will support this version as Minimum SDK field.

      6. Leave the other options as they are.

      7. Click Finish.

  4. If Existing project is opened then,

    1. Check whether the Minimum SDK is API 21 or not, if not then change it into API 21: Android 5.0 (Lollipop) version.

    2. Check whether the Language of the Project is Java or not, if not create new project or change the language of present project into java

  5. With the Project window open, select View > Tool Windows > Project and the Android view is selected from the drop-down list at the top of that window.

  6. Add user permissions to the ManiFest file located: app > manifests > AndroidManifest.xml.

    a. Internet Permissions

<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>

b. Location Permissions

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>

c. Internal storage permissions for uploading images

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

7. Add the Activity tag under application tag in the Manifest file as shown below,

<activity
android:name=".WebContainerActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|
uiMode|screenSize|smallestScreenSize"/>

8. If you're working with the Http Url rather than Https, Then You need to add below line, in Manifest File file located: app > manifests > AndroidManifest.xml. Under application tag,

<application
	. . .
	android:usesCleartextTraffic="true"
	. . .
</application>

After opening the url, copy the two java files: ConstantsUtility and WebContainerActivity into the java folder on Android Studio. Java folder is located on app > java > com.example.yourappname

You should be able to paste the files into this folder.

Copy the file activity_web_container.xml and paste into the layout folder.

12. To include animation effects when moving from one activity to another activity, copy the anim folder from the link below to the app > res directory.

Note

If animation effects are to be excluded you should remove the line 324 in WebContainerActivity java class and line 124 in ConstantsUtility java class.

13. You're done with basic Requirements of the project. Next section will cover how to set up a call to a method to run the Satisfi WebView.

Integrating WebView Classes

  1. Call the following method from the ConstantsUtility class:

    1. openWebView(String baseUrl, String UrlParams, Context context, boolean openInWebView, boolean topBar, boolean bottomBar)

      For this method you’ll need to the following parameters:

    2. baseUrl - In this you need to pass the Url without parameters

    3. UrlParams - In this you need to pass the parameters of the url

    4. Context - In this you need to pass the Present Activity context, For example - you're in MainActivity in your project, want to open a WebView Activity then you need to pass the context of MainActivity in the above method

    5. Open In Webview - In this you need to pass boolean value, if true has passed then it will open the url in webView. If false has passed then it will open the url in chrome browser.

    6. Top Bar - In this you need to pass boolean value, if true then top bar will be displayed only in webView only otherwise the top bar is hidden.

    7. Bottom Bar - In this you need to pass boolean value, if true then bottom bar will be displayed only in webView only otherwise the top bar is hidden.

  2. Call Method “openWebView” from your Current Activity. String valueFromMethod = ConstantsUtility.openWebView("https://chat.satis.fi/?pageID=", "4398", CurrentActivity.this, true, true, true); This method has a return type of a String. This method returns a string only when there is an error in the URL only, Otherwise it opens WebView Activity. If the URL has any error then the Method will returns,

    1. “Zero” - Which means the URL length is zero

    2. “InvalidUrl” - Which means the URL is not a valid one.

    3. “noInternetConnection” - Which means the user does not have Internet connectivity.

Note

This method should run in background only. If you want to show the user some action is done in the background then you can use ProgressBar.

Sample Code For Background Execution

progressDialog.show();
new Thread(() -> {
   String error = ConstantsUtility.openWebView("https://chat.satisfitest.us/?pageID=1897", "",
YourActivity.this, true, true, true);
   runOnUiThread(() -> {
       switch (getError) {
           case ConstantsUtility.urlLength:	// If the url length is ‘0’ then this will be executed      
               progressDialog.dismiss();
               break;
           case ConstantsUtility.noInternet:	// If the user does not have internet this will be executed
               progressDialog.dismiss();
               break;
           case ConstantsUtility.inValidURL:	// If the user enter wrong url this will be executed
               progressDialog.dismiss();
               break;
           default:					// this is for dismissing the progress bar
               progressDialog.dismiss();
               break;
       }
   });
}).start();

Additional Recommendations

  1. Avoid loading the Chat Webview with modals on Android. This may cause undesired scrolling behavior and display issues when the keyboard is loaded.

  2. Avoid using the following setting: android:windowSoftInputMode="adjustPan" This may cause the input container to be hidden when the keyboard is loaded.

9. Open the Java folder to copy Two Java files, which are located at the following url:

10. Open the folder Layout which is located on app > res > layout. Here you will need to paste one xml file i.e activity_web_container.xml which is located at the following url:

11. Copy the images and respective xml files in the Drawable folder from following url: Open above link and copy the following files: back.xml, exit.xml, refresh.xml and progressbar_circular.xml and paste into app > res > drawable folder.

https://play.google.com/store/apps/details?id=com.satisfilabs.webclient
https://github.com/satisfi-github/SatisfiInAppWebviewAndroid
https://chat.satis.fi/?pageID=4398
https://bitbucket.org/satisfi/satisfiinappwebviewandroid/src/master/satisfilabsandroid/app/src/main/java/com/satisfilabs/webclient/
https://bitbucket.org/satisfi/satisfiinappwebviewandroid/src/master/satisfilabsandroid/app/src/main/res/layout/ Copy the file activity_web_container.xml and paste into the layout folder
https://bitbucket.org/satisfi/satisfiinappwebviewandroid/src/master/satisfilabsandroid/app/src/main/res/drawable/
https://bitbucket.org/satisfi/satisfiinappwebviewandroid/src/master/satisfilabsandroid/app/src/main/res/
Page cover image