Quick Reference - Fetch call logs:
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 theCallLogRequestBuilder to customize the call logs fetching process:
CallLogRequestBuilder settings:
| Setting | Description |
|---|---|
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
ThefetchNext() method retrieves the next set of call logs.
Fetch Previous
ThefetchPrevious() method retrieves the previous set of call logs.
Get Call Details
To retrieve the specific details of a call, use thegetCallDetails() method:
Best Practices
Best Practices
- 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
Troubleshooting
Troubleshooting
- Call logs return empty: Verify the
authTokenis 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
sessionIDcorresponds 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