Custom Label In Chat Window
Learn how to add a custom label in header or footer inside the chat window
You can add a custom label in chat window by using our iFlyChat JavaScript SDK. This would allow you to add your own content inside the chat window either in header or footer. It can be used for declaring chat rules and regulations or for showing advertisements.
We have a function named iflychat.renderLabelInChatWindow in JS SDK for this purpose. It takes an object as parameter which should have following properties:
    id
    position
    content
An example is shown below:
1
window.iflychatAsyncInit = function() {
2
3
// All iFlyChat related code should be defined here
4
5
/** iFlyChat Init function **/
6
7
iflychat.init({
8
9
userlist : {
10
visible: true
11
}
12
13
});
14
15
/** iFlyChat ready event **/
16
iflychat.on('ready', function() {
17
18
var htmlContent = '<div style="padding:2px;">';
19
htmlContent += 'This is a custom label above the chat window.';
20
htmlContent += '<div style="color:red;">';
21
htmlContent += 'You can also customise look and feel.';
22
htmlContent += '</div>';
23
htmlContent += '</div>';
24
25
iflychat.renderLabelInChatWindow({
26
id: 'c-0',
27
position: 'above-chat-content',
28
content: htmlContent
29
});
30
});
31
};
Copied!
Please note that you should be using Enterprise plan in order to be able to use this feature.
It will look like this:
iFlyChat - Add custom label in chat window
Last modified 1yr ago
Copy link