Skip to main content
Version: v4

Call Logs

Overview

CometChatCallLogs is a Component that shows the list of Call Log available . By default, names are shown for all listed users, along with their avatar if available.

Image

The Call Logs is comprised of the following components:

ComponentsDescription
CometChatLista reusable container component having title, search box, customisable background and a List View
cometchat-backdropThis element represents the background against which other elements are presented.
CometChatListItema component that renders data obtained from a Group object on a Tile having a title, subtitle, leading and trailing view
cometchat-dateThis Component used to show the date and time. You can also customize the appearance of this widget by modifying its logic.
cometchat-buttonThis component represents a button with optional icon and text.

Usage

Integration

import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from "@angular/core";
import { BrowserModule } from "@angular/platform-browser";
import { CometChatCallLogs } from "@cometchat/chat-uikit-angular";
import { AppComponent } from "./app.component";

@NgModule({
imports: [BrowserModule, CometChatCallLogs],
declarations: [AppComponent],
providers: [],
bootstrap: [AppComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}

Actions

Actions dictate how a component functions. They are divided into two types: Predefined and User-defined. You can override either type, allowing you to tailor the behavior of the component to fit your specific needs.

1. onItemClick

OnItemClick is triggered when you click on a ListItem of the Call Logs component. By default it initiate a call to the participant associated with the respective ListItem. You can override this action using the following code snippet.

import { CometChat } from '@cometchat/chat-sdk-javascript';
import { Component, OnInit } from '@angular/core';
import { CometChatThemeService, CometChatUIKit } from '@cometchat/chat-uikit-angular';
import "@cometchat/uikit-elements";

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {

constructor(private themeService:CometChatThemeService) {
themeService.theme.palette.setMode("light")
themeService.theme.palette.setPrimary({ light: "#6851D6", dark: "#6851D6" })
}
public handleOnItemClick = (call: any) =>{
console.log("your custom on item click");
};
onLogin(UID?: any) {
CometChatUIKit.login({ uid: UID }).then(
(user) => {
setTimeout(() => {
window.location.reload();
}, 1000);
},
(error) => {
console.log("Login failed with exception:", { error });
}
);
}
}
2. onInfoClick

onInfoClick is triggered when you click the Info button Icon of the Call Logs component. It does not have a default behavior. However, you can override its behavior using the following code snippet.

import { CometChat } from '@cometchat/chat-sdk-javascript';
import { Component, OnInit } from '@angular/core';
import { CometChatThemeService, CometChatUIKit } from '@cometchat/chat-uikit-angular';
import "@cometchat/uikit-elements";

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {

constructor(private themeService:CometChatThemeService) {
themeService.theme.palette.setMode("light")
themeService.theme.palette.setPrimary({ light: "#6851D6", dark: "#6851D6" })
}
public handleOnInfoClick = (call: any) => {
console.log("your custom on info click actions", call);
}
onLogin(UID?: any) {
CometChatUIKit.login({ uid: UID }).then(
(user) => {
setTimeout(() => {
window.location.reload();
}, 1000);
},
(error) => {
console.log("Login failed with exception:", { error });
}
);
}
}
3. onError

This action doesn't change the behavior of the component but rather listens for any errors that occur in the Call Logs component.

import { CometChat } from '@cometchat/chat-sdk-javascript';
import { Component, OnInit } from '@angular/core';
import { CometChatThemeService, CometChatUIKit } from '@cometchat/chat-uikit-angular';
import "@cometchat/uikit-elements";

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {

constructor(private themeService:CometChatThemeService) {
themeService.theme.palette.setMode("light")
themeService.theme.palette.setPrimary({ light: "#6851D6", dark: "#6851D6" })
}
public handleOnError = (error: CometChat.CometChatException) => {
console.log("your custom on error action", error);
};
onLogin(UID?: any) {
CometChatUIKit.login({ uid: UID }).then(
(user) => {
setTimeout(() => {
window.location.reload();
}, 1000);
},
(error) => {
console.log("Login failed with exception:", { error });
}
);
}
}

Filters

Filters allow you to customize the data displayed in a list within a Component. You can filter the list based on your specific criteria, allowing for a more customized. Filters can be applied using RequestBuilders of Chat SDK.

1. CallLogRequestBuilder

The CallLogRequestBuilder enables you to filter and customize the Call Log based on available parameters in CallLogRequestBuilder. This feature allows you to create more specific and targeted queries when fetching the call logs. The following are the parameters available in CallLogRequestBuilder

MethodsTypeDescription
setLimitnumberSpecifies the number of call logs to fetch.
setCallTypeStringSets the type of calls to fetch (call or meet).
setCallStatuscallStatusSets the status of calls to fetch (initiated, ongoing, etc.)
setHasRecordingbooleanSets whether to fetch calls that have recordings.
setCallCategorystringSets the category of calls to fetch (call or meet).
setCallDirectionstringSets the direction of calls to fetch (incoming or outgoing)
setUidstringSets the UID of the user whose call logs to fetch.
setGuidstringSets the GUID of the user whose call logs to fetch.
setAuthTokenstringSets the Auth token of the logged-in user.

Example

In the example below, we're filtering Call Logs to show only canceled calls and setting the limit to five.

import { CometChat } from '@cometchat/chat-sdk-javascript';
import { Component, OnInit } from '@angular/core';
import { CometChatThemeService, CometChatUIKit } from '@cometchat/chat-uikit-angular';
import { CallLogRequestBuilder } from '@cometchat/calls-sdk-javascript';
import "@cometchat/uikit-elements";

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {

constructor(private themeService:CometChatThemeService) {
themeService.theme.palette.setMode("light")
themeService.theme.palette.setPrimary({ light: "#6851D6", dark: "#6851D6" })
}
callLogRequestBuilder = new CallLogRequestBuilder().setAuthToken("authtoken").setLimit(5).setCallStatus("cancelled")

onLogin(UID?: any) {
CometChatUIKit.login({ uid: UID }).then(
(user) => {
setTimeout(() => {
window.location.reload();
}, 1000);
},
(error) => {
console.log("Login failed with exception:", { error });
}
);
}
}

Events

Events are emitted by a Component. By using event you can extend existing functionality. Being global events, they can be applied in Multiple Locations and are capable of being Added or Removed.

The list of events emitted by the Call Logs component is as follows.

EventDescription
ccMessageSentThis event is triggered when the sent message is in transit and also when it is received by the receiver.

Adding CometChatCallEvents Listener's

import {CometChatCallEvents} from "@cometchat/chat-uikit-angular";

this.ccMessageSent = CometChatCallEvents.ccMessageSent.subscribe(
() => {
// Your Code
}
);


Removing CometChatCallEvents Listener's

this.ccMessageSent.unsubscribe();

Customization

To fit your app's design requirements, you can customize the appearance of the Call Logs component. We provide exposed methods that allow you to modify the experience and behavior according to your specific needs.

Style

Using Style you can customize the look and feel of the component in your app, These parameters typically control elements such as the color, size, shape, and fonts used within the component.

1. CallLogs Style

To customize the appearance, you can assign a CallLogsStyle object to the Call Logs component.

Example

In this example, we are employing the callLogsStyle.

import { CometChat } from '@cometchat/chat-sdk-javascript';
import { Component, OnInit } from '@angular/core';
import { CometChatThemeService, CometChatUIKit } from '@cometchat/chat-uikit-angular';
import { CallLogsStyle } from '@cometchat/uikit-shared';
import "@cometchat/uikit-elements";

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {

constructor(private themeService:CometChatThemeService) {
themeService.theme.palette.setMode("light")
themeService.theme.palette.setPrimary({ light: "#6851D6", dark: "#6851D6" })
}
callLogsStyle = new CallLogsStyle({
background: "#dac6f5",
titleColor: "#000000",
dateTextColor: "#dac6f5",
});
onLogin(UID?: any) {
CometChatUIKit.login({ uid: UID }).then(
(user) => {
setTimeout(() => {
window.location.reload();
}, 1000);
},
(error) => {
console.log("Login failed with exception:", { error });
}
);
}
}
Image

The following properties are exposed by CallLogsStyle:

PropertyDescriptionCode
borderUsed to set borderborder?: string,
borderRadiusUsed to set border radiusborderRadius?: string;
backgroundUsed to set background colourbackground?: string;
heightUsed to set heightheight?: string;
widthUsed to set widthwidth?: string;
titleFontUsed to set title fonttitleFont?: string,
titleColorUsed to set title colortitleColor?: string;
emptyStateTextColorUsed to set empty state text coloremptyStateTextColor?: string;
emptyStateTextFontUsed to set empty state text fontemptyStateTextFont?: string;
errorStateTextColorUsed to set error state text colorerrorStateTextColor?: string;
errorStateTextFontUsed to set error state text fonterrorStateTextFont?: string;
loadingIconTintUsed to set loading icon tintloadingIconTint?: string;
infoIconTintUsed to set info icon tintinfoIconTint?: string;
missedCallIconTintUsed to set missed call icon tintmissedCallIconTint?: string;
outgoingCallIconTintUsed to set outgoing call icon tintoutgoingCallIconTint?: string;
incomingCallIconTintUsed to set incoming call icon tintincomingCallIconTint?: string;
callStatusTextFontUsed to set call status text fontcallStatusTextFont?: string;
callStatusTextColorUsed to set call status text colorcallStatusTextColor?: string;
dateTextFontUsed to set date text fontdateTextFont?: string;
dateTextColorUsed to set date text colordateTextColor?: string;
dateSeparatorTextFontUsed to set date separator text fontdateSeparatorTextFont?: string;
dateSeparatorTextColorUsed to set date separator text colordateSeparatorTextColor?: string;
2. Avatar Style

If you want to apply customized styles to the Avatar component within the Call Logs Component, you can use the following code snippet. For more information you can refer Avatar Styles.

import { CometChat } from '@cometchat/chat-sdk-javascript';
import { Component, OnInit } from '@angular/core';
import { CometChatThemeService, CometChatUIKit, AvatarStyle } from '@cometchat/chat-uikit-angular';
import "@cometchat/uikit-elements";

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {

constructor(private themeService:CometChatThemeService) {
themeService.theme.palette.setMode("light")
themeService.theme.palette.setPrimary({ light: "#6851D6", dark: "#6851D6" })
}
avatarStyle = new AvatarStyle({
backgroundColor: "#cdc2ff",
border: "2px solid #6745ff",
borderRadius: "10px",
outerViewBorderColor: "#ca45ff",
outerViewBorderRadius: "5px",
nameTextColor: "#4554ff"
});
onLogin(UID?: any) {
CometChatUIKit.login({ uid: UID }).then(
(user) => {
setTimeout(() => {
window.location.reload();
}, 1000);
},
(error) => {
console.log("Login failed with exception:", { error });
}
);
}
}
3. ListItem Style

If you want to apply customized styles to the List Item component within the Call Logs Component, you can use the following code snippet. For more information, you can refer ListItem Styles.

import { CometChat } from '@cometchat/chat-sdk-javascript';
import { Component, OnInit } from '@angular/core';
import { CometChatThemeService, CometChatUIKit, ListItemStyle } from '@cometchat/chat-uikit-angular';
import "@cometchat/uikit-elements";

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {

constructor(private themeService:CometChatThemeService) {
themeService.theme.palette.setMode("light")
themeService.theme.palette.setPrimary({ light: "#6851D6", dark: "#6851D6" })
}
listItemStyle: ListItemStyle = new ListItemStyle({
background: "transparent",
padding: "5px",
border: "1px solid #e9b8f5",
titleColor: "#8830f2",
borderRadius: "20px",
width: "100% !important"
});
onLogin(UID?: any) {
CometChatUIKit.login({ uid: UID }).then(
(user) => {
setTimeout(() => {
window.location.reload();
}, 1000);
},
(error) => {
console.log("Login failed with exception:", { error });
}
);
}
}

Functionality

These are a set of small functional customizations that allow you to fine-tune the overall experience of the component. With these, you can change text, set custom icons, and toggle the visibility of UI elements.

Here is a code snippet demonstrating how you can customize the functionality of the Call Logs component.

import { CometChat } from '@cometchat/chat-sdk-javascript';
import { Component, OnInit } from '@angular/core';
import { CometChatThemeService, CometChatUIKit } from '@cometchat/chat-uikit-angular';
import { DatePatterns } from '@cometchat/uikit-resources';
import "@cometchat/uikit-elements";

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {

constructor(private themeService:CometChatThemeService) {
themeService.theme.palette.setMode("light")
themeService.theme.palette.setPrimary({ light: "#6851D6", dark: "#6851D6" })
}
public datePattern: DatePatterns = DatePatterns.DateTime;

onLogin(UID?: any) {
CometChatUIKit.login({ uid: UID }).then(
(user) => {
setTimeout(() => {
window.location.reload();
}, 1000);
},
(error) => {
console.log("Login failed with exception:", { error });
}
);
}
}

Default:

Image

Custom:

Image

Below is a list of customizations along with corresponding code snippets

PropertyDescriptionCode
titleUsed to set custom title[title]="'Your Custom Title'"
emptyStateTextUsed to set custom empty state text[emptyStateText]="'Your Custom Empty State Text'"
errorStateTextUsed to set custom error state text[errorStateText]="'Your Custom Error State Text'"
titleAlignmentUsed to set custom title alignment[titleAlignment]="titleAlignment"
datePatternUsed to set custom date pattern[datePattern]="datePattern"
dateSeparatorPatternUsed to set custom date separator pattern[dateSeparatorPattern]="dateSeparatorPattern"
infoIconUrlUsed to set custom info icon[infoIconUrl]="infoIconURL"
incomingAudioCallIconUrlUsed to set custom incoming audio call icon[incomingAudioCallIconUrl]="incomingAudioCallIconUrl"
missedAudioCallIconUrlUsed to set custom missed audio call icon[missedAudioCallIconUrl]="missedAudioCallIconUrl"
missedVideoCallIconUrlUsed to set custom missed video call icon[missedVideoCallIconUrl]='Custom Missed Video Call Icon'
incomingVideoCallIconUrlUsed to set custom incoming video call icon[incomingVideoCallIconUrl]="incomingVideoCallIconUrl"
outgoingAudioCallIconUrlUsed to set custom outgoing audio call icon[outgoingAudioCallIconUrl]="outgoingAudioCallIconUrl"
outgoingVideoCallIconUrlUsed to set custom outgoing video call icon[outgoingVideoCallIconUrl]="outgoingVideoCallIconUrl"
loadingIconURLUsed to set custom loading icon[loadingIconURL]="loadingIconURL"
hideSeparatorOption to hide separator[hideSeparator]="false"
activeCallUsed to set active Call that is currently selected[activeCall]="callObject"

Advanced

For advanced-level customization, you can set custom views to the component. This lets you tailor each aspect of the component to fit your exact needs and application aesthetics. You can create and define your views, layouts, and UI elements and then incorporate those into the component.


ListItemView

With this property, you can assign a custom ListItem to the Call Logs Component.

Example

Default:

Image

Custom:

Image
import { CometChat } from '@cometchat/chat-sdk-javascript';
import { Component, OnInit } from '@angular/core';
import { CometChatThemeService, CometChatUIKit } from '@cometchat/chat-uikit-angular';
import "@cometchat/uikit-elements";

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {

constructor(private themeService:CometChatThemeService) {
themeService.theme.palette.setMode("light")
themeService.theme.palette.setPrimary({ light: "#6851D6", dark: "#6851D6" })
}

onLogin(UID?: any) {
CometChatUIKit.login({ uid: UID }).then(
(user) => {
setTimeout(() => {
window.location.reload();
}, 1000);
},
(error) => {
console.log("Login failed with exception:", { error });
}
);
}
}

SubtitleView

You can customize the subtitle view for each call logs item to meet your requirements

Default:

Image

Custom:

Image
import { CometChat } from '@cometchat/chat-sdk-javascript';
import { Component, OnInit } from '@angular/core';
import { CometChatThemeService, CometChatUIKit } from '@cometchat/chat-uikit-angular';
import "@cometchat/uikit-elements";

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {

constructor(private themeService:CometChatThemeService) {
themeService.theme.palette.setMode("light")
themeService.theme.palette.setPrimary({ light: "#6851D6", dark: "#6851D6" })
}

onLogin(UID?: any) {
CometChatUIKit.login({ uid: UID }).then(
(user) => {
setTimeout(() => {
window.location.reload();
}, 1000);
},
(error) => {
console.log("Login failed with exception:", { error });
}
);
}
}

TailView

You can customize the tail view for each call logs item to meet your requirements

Default:

Image

Custom:

Image
import { CometChat } from '@cometchat/chat-sdk-javascript';
import { Component, OnInit } from '@angular/core';
import { CometChatThemeService, CometChatUIKit } from '@cometchat/chat-uikit-angular';
import "@cometchat/uikit-elements";

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {

constructor(private themeService:CometChatThemeService) {
themeService.theme.palette.setMode("light")
themeService.theme.palette.setPrimary({ light: "#6851D6", dark: "#6851D6" })
}

onLogin(UID?: any) {
CometChatUIKit.login({ uid: UID }).then(
(user) => {
setTimeout(() => {
window.location.reload();
}, 1000);
},
(error) => {
console.log("Login failed with exception:", { error });
}
);
}
}

LoadingStateView

You can set a custom loader view using loadingStateView to match the loading view of your app.

Default:

Image

Custom:

Image
import { CometChat } from '@cometchat/chat-sdk-javascript';
import { Component, OnInit } from '@angular/core';
import { CometChatThemeService, CometChatUIKit, LoaderStyle } from '@cometchat/chat-uikit-angular';
import "@cometchat/uikit-elements";

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {

constructor(private themeService:CometChatThemeService) {
themeService.theme.palette.setMode("light")
themeService.theme.palette.setPrimary({ light: "#6851D6", dark: "#6851D6" })
}
getLoaderStyle: LoaderStyle = new LoaderStyle({
iconTint: "red",
background: "transparent",
height: "20px",
width: "20px",
border: "none",
borderRadius: "0",
});
onLogin(UID?: any) {
CometChatUIKit.login({ uid: UID }).then(
(user) => {
setTimeout(() => {
window.location.reload();
}, 1000);
},
(error) => {
console.log("Login failed with exception:", { error });
}
);
}
}

EmptyStateView

You can set a custom EmptyStateView using emptyStateView to match the empty view of your app.

Default:

Image

Custom:

Image
import { CometChat } from '@cometchat/chat-sdk-javascript';
import { Component, OnInit } from '@angular/core';
import { CometChatThemeService, CometChatUIKit } from '@cometchat/chat-uikit-angular';
import "@cometchat/uikit-elements";

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {

constructor(private themeService:CometChatThemeService) {
themeService.theme.palette.setMode("light")
themeService.theme.palette.setPrimary({ light: "#6851D6", dark: "#6851D6" })
}

onLogin(UID?: any) {
CometChatUIKit.login({ uid: UID }).then(
(user) => {
setTimeout(() => {
window.location.reload();
}, 1000);
},
(error) => {
console.log("Login failed with exception:", { error });
}
);
}
}

ErrorStateView

You can set a custom ErrorStateView using errorStateView to match the error view of your app.

import { CometChat } from '@cometchat/chat-sdk-javascript';
import { Component, OnInit } from '@angular/core';
import { CometChatThemeService, CometChatUIKit } from '@cometchat/chat-uikit-angular';
import "@cometchat/uikit-elements";

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {

constructor(private themeService:CometChatThemeService) {
themeService.theme.palette.setMode("light")
themeService.theme.palette.setPrimary({ light: "#6851D6", dark: "#6851D6" })
}

onLogin(UID?: any) {
CometChatUIKit.login({ uid: UID }).then(
(user) => {
setTimeout(() => {
window.location.reload();
}, 1000);
},
(error) => {
console.log("Login failed with exception:", { error });
}
);
}
}

Configurations

Configurations offer the ability to customize the properties of each component within a Composite Component.

CometChatCallLogs has OutGoing Call component. Hence, each of these components will have its individual `Configuration``.

  • Configurations expose properties that are available in its individual components.

OutGoing Call

You can customize the properties of the OutGoing Call component by making use of the OutgoingCallConfiguration.

All exposed properties of OutgoingCallConfiguration can be found under OutGoing Call. Properties marked with the report symbol are not accessible within the Configuration Object.

Example

Let's say you want to change the style of the OutGoing Call subcomponent and, in addition, you want to change the decline button icon.

You can modify the style using the outgoingCallStyle property and set custom decline button icon using declineButtonIconURL property.

Image
import { CometChat } from '@cometchat/chat-sdk-javascript';
import { Component, OnInit } from '@angular/core';
import { CometChatThemeService, CometChatUIKit } from '@cometchat/chat-uikit-angular';
import { OutgoingCallConfiguration, OutgoingCallStyle } from '@cometchat/uikit-shared';
import "@cometchat/uikit-elements";

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {

constructor(private themeService:CometChatThemeService) {
themeService.theme.palette.setMode("light")
themeService.theme.palette.setPrimary({ light: "#6851D6", dark: "#6851D6" })
}
outgoingCallStyle = new OutgoingCallStyle({
background: "#e0d5f5",
declineButtonIconBackground: "#6830d1",
height: "500px",
width: "300px",
declineButtonTextColor: "#ffffff",
titleTextColor: "#ffffff",
subtitleTextColor: "#9213d6",
declineButtonIconTint: "#dbb1f2",
border: "1px solid #e6e6e6",
borderRadius: "12px",
});
public outgoingCallConfiguration = new OutgoingCallConfiguration({
//override properties of out going call
outgoingCallStyle: this.outgoingCallStyle,
declineButtonIconURL: 'declineButtonIconURL',
});
onLogin(UID?: any) {
CometChatUIKit.login({ uid: UID }).then(
(user) => {
setTimeout(() => {
window.location.reload();
}, 1000);
},
(error) => {
console.log("Login failed with exception:", { error });
}
);
}
}