Skip to main content
Quick Reference - Fetch call logs:
const loggedInUser = await CometChat.getLoggedinUser();

let callLogRequest = new CometChatCalls.CallLogRequestBuilder()
  .setLimit(30)
  .setAuthToken(loggedInUser.getAuthToken())
  .setCallCategory("call")
  .build();

const callLogs = await callLogRequest.fetchNext();
Available via: SDK | REST API | UI Kits

Overview

CometChat’s React Native Call SDK provides a comprehensive way to integrate call logs into your application, allowing users to keep track of their communication history. Call logs provide crucial information such as call duration, participants, and more.

Fetching Call Logs

Use the CallLogRequestBuilder to customize the call logs fetching process:
let callLogRequestBuilder = new CometChatCalls.CallLogRequestBuilder()
        .setLimit(30)
        .setAuthToken(loggedInUser.getAuthToken())
        .setCallCategory("call")
        .build()
CallLogRequestBuilder settings:
SettingDescription
setLimit(limit: number)Specifies the number of call logs to fetch.
setCallType(callType: 'video' or 'audio')Sets the type of calls to fetch.
setCallStatus(callStatus: 'ongoing' or 'busy' or 'rejected' or 'cancelled' or 'ended' or 'missed')Sets the status of calls to fetch.
setHasRecording(hasRecording: boolean)Sets whether to fetch calls that have recordings.
setCallCategory(callCategory: 'call' or 'meet')Sets the category of calls to fetch.
setCallDirection(callDirection: 'incoming' or 'outgoing')Sets the direction of calls to fetch.
setUid(uid: string)Sets the UID of the user whose call logs to fetch.
setGuid(guid: string)Sets the GUID of the user whose call logs to fetch.
setAuthToken(authToken: string)Sets the Auth token of the logged-in user.

Fetch Next

The fetchNext() method retrieves the next set of call logs.
callLogRequestBuilder.fetchNext()
  .then(callLogHistory => {
    console.log(callLogHistory);
  })
  .catch(err => {
     console.log(err);
  });

Fetch Previous

The fetchPrevious() method retrieves the previous set of call logs.
callLogRequestBuilder.fetchPrevious()
  .then(callLogHistory => {
    console.log(callLogHistory);
  })
  .catch(err => {
     console.log(err);
  });

Get Call Details

To retrieve the specific details of a call, use the getCallDetails() method:
var sessionID = "SESSION_ID";
CometChatCalls.getCallDetails(sessionID, authToken)
  .then((callLogs) => {
    console.log(callLogs);
  })
  .catch(err => {
    console.log(err);
  });
  • Use pagination with a reasonable setLimit() value (e.g., 20-30) rather than fetching all logs at once
  • Use the builder’s filter methods to fetch only relevant logs for your current UI view
  • Consider caching fetched call logs locally to reduce API calls
  • Call logs return empty: Verify the authToken is valid and calls have actually been made
  • fetchNext returns the same results: Reuse the same builder instance for pagination
  • getCallDetails returns no data: Confirm the sessionID corresponds to a completed call

Next Steps

Ringing

Implement a complete calling experience with incoming and outgoing call UI

Call Session

Start and manage call sessions with full configuration options

Recording

Record call sessions for playback and compliance

Standalone Calling

Implement calling without the Chat SDK