Signup and Authentication on Android SDK
- Getting Started
- Bot Building
- 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
- Agent Setup
- Analytics & Reporting
- Notifications
- Commerce Plus
- Troubleshooting Guides
- Release Notes
Table of Contents
Haptik SDK supports two types of user authentication:
1. Guest Signup
SDK creates a new user, without any specific details.
Kotlin Code:
fun launchGuestConversation() { HaptikSDK.loadGuestConversation() }
Java Code:
Public void launchGuestConversation(){ HaptikSDK.INSTANCE.loadGuestConversation(); }
2. Custom signup
For cases when the client/parent application already has a signup flow in place and wants to link the same user to the SDK. Prepare SignupData object with required data and pass it to Haptik SDK.
Kotlin Code:
fun launchCustomSignupConversation() { val signupData = SignupData().apply { authCode = "YOUR_AUTH_CODE" authId = "YOUR_AUTH_ID" signupType = "third_party" customData = JSONObject().apply { put("custom-data-one", "date-one") put("custom-data-two", "data-two") } } HaptikSDK.loadConversation(signupData) }
Java Code:
public void launchCustomSignUpConversation(){ SignupData signupData = new SignupData(); signupData.setAuthCode("YOUR_AUTH_CODE"); signupData.setAuthId("YOUR_AUTH_ID"); signupData.setSignupType("third_party"); JSONObject jsonObject = new JSONObject(); jsonObject.put("custom-data-wrapper-one", "data-one"); jsonObject.put("custom-data-wrapper-two", "data-two"); signupData.setCustomData(jsonObject); HaptikSDK.INSTANCE.loadConversation(signupData) }
SignupData Options:
- authId <String> : User Identifier [Mandatory]
- authCode <String> : Authorisation Token [Mandatory]
- username <String> : The name of the signed in user[Optional]
- email <String> : Email id of signed in user[Optional]
- mobileNo <String> : Mobile number of signed in user[Optional]
- customData <Object> : Arbitrary custom data that the client needs to send[Optional]
Points to note:
1. You have to call:
HaptikSDK.loadGuestConversation() or HaptikSDK.loadConversation(signupData) every time you want to take users to the conversation screen. If the user is not logged in, HaptikSDK will perform the signup and open the conversation screen. If the user is already logged in, HaptikSDK will simply open the conversation screen.
2. Check if the Verification Endpoint has been added. Click here for better understanding.