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
  • Web SDK

Does Web SDK support native platforms?(Legacy)

Written by Medha Anand

Updated on October 19th, 2021

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

The SDK supports integrations with Native platforms such as iOS and Android. This is done with the help of a Web View.

Android

To ensure that the SDK loads up inside an Android WebView. Make sure the following permissions are present in the Manifest

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

The following settings on the WebView are also necessary to ensure the SDK has the necessary permissions.

webSettings.setJavaScriptEnabled(true);
webSettings.setDomStorageEnabled(true);
webSettings.setLoadWithOverviewMode(true);
webSettings.setLoadsImagesAutomatically(true);
webSettings.setAppCacheEnabled(true);

The lifecycle of a WebPage in WebView is coupled to the Android app lifecycle. Therefore for proper user experience, we need to notify Haptik SDK when the app goes in the background. Below is the code snippet to do so.

override fun onStop() {
 super.onStop()
 webview.loadUrl("javascript:window.HaptikSDK.pause();")
}
Delete

Note

If we use Web SDK deployment for the Haptik bot on Android app, then we would require an additional configuration for the upload file buttons to work.

As the Web SDK has been integrated into the Webview, it cannot directly open up the file system to allow the user to select a file to upload.

We would need to implement a callback on the Webview which can open up the file system.

You can refer here for the link to the documentation to help you with this process

iOS

iOS doesn't need any extra permissions in order to operate. Just open the HTML file where you've configured the SDK inside the app.

Just like Android, in iOS as well the lifecycle of a WebPage is coupled to the iOS app lifecycle. We need to notify Haptik SDK when the app goes in the background. To do this, please add an inactive state observer in your view controller which consists of the WkWebView, and add the following code:

 override func viewDidLoad() {
 super.viewDidLoad()
 // Register background notification
 NotificationCenter.default.addObserver(
 forName: UIApplication.willResignActiveNotification,
 object: nil,
 queue: nil,
 using: { note in
 // App moved to background!
 self.webView?.evaluateJavaScript("window.HaptikSDK.pause();", completionHandler: nil)
 })
 }
 deinit {
 // Remove Notification observer
 NotificationCenter.default.removeObserver(self, name: UIApplication.willResignActiveNotification, object: nil)
 }

Clevertap is not supported for Web SDK & Android SDK. 

If you are not using the Haptik SDK with CleverTap Multi-instance SDK and if you're already using CleverTap SDK in your app and sending analytic events then there might be a potential issue where CleverTap can't support two different accounts' events getting fired from one app.

In this case, don't enable CleverTap functionality for Haptik SDK.

Was this article helpful?

Yes
No
Give feedback about this article

Related Articles

  • How to set up a launch message on my website bot?
  • What are the SDK customization methods available?
  • How to deploy a bot on my website?
  • Which all browsers is my website bot compatible on?

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