Enabling Android SDK and Setting Up Related Credentials

Enabling Android SDK Platform

  1. Go to Business Manager > Channels > Platform Deployments and choose Android SDK from Platform drop-down.
  2. One can also set up webhooks by providing the Webhook URL and enabling the Webhook and putting Email IDs below it.
  3. Now, turn on the Active toggle button to enable this platform deployment.

Passing Bot Credentials to Android SDK

You can pass bot credentials through your app's strings.xml file or programmatically while initializing the SDK. These credentials will be provided by Haptik.


Using strings.xml

<resources>
    .
    .
    <string name="haptik_base_url">BOT_BASE_URL</string>
    <string name="haptik_client_id">BOT_CLIENT_ID</string>
    <string name="haptik_business_id">BOT_BUSINESS_ID</string>
</resources>


Programmatically

Kotllin:

val initData =  InitData().apply {
    clientId:"BOT CLIENT ID"
    businessId: "BOT BUSINESS ID"
    base_url: "BOT BASE URL"
}
HaptikSDK.init(context, initData)

Java: 

InitData initData = new InitData();
initData.setBase_url("BOT BASE URL");
initData.setBusinessId("BOT BUSINESS ID");
initData.setClientId("BOT CLIENT ID");

HaptikSDK.INSTANCE.init(context, initData);

Read more on SDK initialization here.



Can’t find what you’re looking for? Email us at support@haptik.ai.