Initializing SDK for Android SDK
- Getting Started
- Bot Building
- Smart Agent Chat
- Conversation Design
-
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
- External Agent Tool Setup
- Analytics & Reporting
- Notifications
- Commerce Plus
- Troubleshooting Guides
- Release Notes
Table of Contents
Haptik SDK MUST be initialized before using any of Haptik's functionality.
Make sure you are adding the following code in your app's application class:
Kotlin Code:
class App : Application() { override fun onCreate() { super.onCreate() val initData = InitData() HaptikSDK.init(applicationContext, initData, sdkEvents) } }
Java Code:
public class App extends Application { @Override public void onCreate() { super.onCreate(); InitData initData = new InitData(); HaptikSDK.INSTANCE.init(applicationContext, initData, sdkEvents); } }
Parameter Information
initData(Optional)
InitData is used to add customization in SDK. Read more here.
sdkEvents(Optional)
If provided, you will receive the SDK events data. Majorly it is used for analytics purposes.
Kotlin Code:
class App : Application() { override fun onCreate() { super.onCreate() val initData = InitData() HaptikSDK.init(applicationContext, initData, this::sdkEventsCallback) } private fun sdkEventsCallback(event: String) { Log.w("Haptik SDK Event", event) } }
Java Code:
public class App extends Application { @Override public void onCreate() { super.onCreate(); InitData initData = new InitData(); HaptikSDK.INSTANCE.init(context, initData, event -> { Log.w("Haptik SDK Event ", event); return null; }); } }