Live Chat SDK React Native
Configuration
First Import the Required Class
import { DolphinProfile, DolphinConnect} from 'dolphin-livechat-connector';The Outline of How to Use The API
/**
* Prepare your customer profile here
*/
let profile = new DolphinProfile();
profile.username= "your name"
profile.email = "your email";
profile.phone = "your phone number";
profile.customerid= "your customerid"; //optional
/**
* Get singleton instance of Dolphin Messenger Connector
* Setup Your Avatar, Client Id, and Client Secret
*/
let dolphinConnect = DolphinConnect.getlnstance(profile);
dolphinConnect.setAvatarCSri Virtual Assistant',
'http://www.inmotion.co.idlassets/images/logolsri_face.png');
dolphinConnect.setDetectorEndpoint('http://example:xxxxx/isonline/14xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.); //optional
dolphinConnect.setAdditionalRestHeaders({ //optional
'ApiKey' : rxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx'
})
dolphinConnect.configure(
"your channel url",
"your channel client id",
"your channel client secret"
);
dolphinConnect.set0nReceiveMethod(this.on any iveMessage);
dolphinConnect.setMessageSentMethod(this.messageSentMethod);
dolphinConnect.setConnectedMethod(this.connectedMethod);
dolphinConnect.setConnectingMethod(this.connectingMethod);
dolphinConnect.setOnAgentTypingMethod(this.onAgentrypingMethod);Connect()
Disconnect()
Connectedmethod
Connectingmethod
onReceivedMethod()
Pure text message
Quick Reply / Suggestion Message
Button Card Message
Image message
onCustomerTyping()
onSend()
Text Message
Image Message
messageSentMethod
onAgentTypingMethod
getChatHistory
checkChannelStatus
additionalRestHeaders
Trigger Menus
Last updated
Was this helpful?