Skip to main content
Quick Reference - Fetch call logs:
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, enhancing your user experience by allowing users to effortlessly keep track of their communication history. Call logs provide crucial information such as call duration, participants, and more. This feature not only allows users to review their past interactions but it also serves as an effective tool to revisit important conversation details. With the flexibility of fetching call logs, filtering them according to specific parameters, and obtaining detailed information of individual calls, application developers can use this feature to build a more robust and interactive communication framework. In the following sections, we will guide you through the process of working with call logs, offering a deeper insight into how to optimally use this feature in your React Native application.

Fetching Call Logs

To fetch all call logs in your React Native application, you should use the CallLogRequestBuilder, This builder allows you to customize the call logs fetching process according to your needs.
CallLogRequestBuilder has the following settings available.

Fetch Next

The fetchNext() method retrieves the next set of call logs.
On SuccessfetchNext() returns an array of CallLog objects:CallLog Array:CallLog Object (each item in array):
initiator Object:
receiver Object:
participants Array:Participant Object (each item in array):
recordings Array:Recording Object (each item in array):
data Object:data.entities Object:data.entities.initiator Object:data.entities.receiver Object:

Fetch Previous

The fetchPrevious() method retrieves the previous set of call logs.
On SuccessfetchPrevious() returns an array of CallLog objects with the same structure as fetchNext(). See fetchNext Response for the complete object structure.

Get Call Details

To retrieve the specific details of a call, use the getCallDetails() method. This method requires the Auth token of the logged-in user and the session ID along with a callback listener.
On SuccessgetCallDetails() returns an array of CallLog objects with the same structure as fetchNext(). See fetchNext Response for the complete object structure.
Replace "SESSION_ID" with the ID of the session you are interested in.

Best Practices

Always use fetchNext() with a reasonable setLimit() value (e.g., 20-30) rather than fetching all logs at once. This improves performance and reduces memory usage, especially for users with extensive call histories.
Use the builder’s filter methods (setCallType, setCallStatus, setCallDirection) to fetch only the logs relevant to your current UI view. For example, show only missed calls in a “Missed” tab rather than filtering client-side.
Consider caching fetched call logs locally to reduce API calls and improve load times. Use fetchNext() to load newer logs and fetchPrevious() for older ones as the user scrolls.

Troubleshooting

Verify that the authToken passed to setAuthToken() is valid and belongs to the logged-in user. Also check that calls have actually been made — call logs are only generated after a call session completes.
Ensure you’re reusing the same callLogRequestBuilder instance for pagination. Creating a new builder resets the cursor, causing the same page to be fetched repeatedly.
Confirm the sessionID is correct and corresponds to a completed call. Active or in-progress calls may not have full details available yet.

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