Skip to main content

Integrate with chat

The current iOS Call SDK no longer uses the older call summary message type as the primary entry point in the documentation. Instead, it exposes call summaries and server-side call logs through NCCallLog. When you integrate with the Chat SDK, the recommended approach is:

  1. Listen for NCCallLog callbacks after the call ends.
  2. Map NCCallLog to your own chat message model or recent conversation summary.
  3. Insert or update the message through the Chat SDK or Chat Kit so the conversation view refreshes.

Callbacks for conversation UI

NCCallEventHandler exposes two call log related events. Each callback receives an event object; read callLog from the payload:

CallbackEvent typeDescription
onLocalCallLogReceived:NCCallLocalCallLogReceivedEventLocally generated 1-to-1 call summary. Best for immediate display.
onServerCallLogReceived:NCCallServerCallLogReceivedEventFinal server-generated call log. Best for sync and history display.

Useful NCCallLog fields

NCCallLog exposes these commonly used properties:

  • callId
  • callType
  • mediaType
  • callerUserId
  • participants
  • duration
  • endReason
  • callDirection
  • startTime
  • endTime
  • syncTime
  • callState
  • currentUserState
  • creationTime

Time-related fields use these units:

  • startTime, endTime, syncTime, and creationTime: milliseconds
  • duration: seconds
Objective C
@interface MyCallHandler () <NCCallEventHandler>
@end

@implementation MyCallHandler

- (void)onLocalCallLogReceived:(NCCallLocalCallLogReceivedEvent *)event {
[self insertLocalSummaryMessage:event.callLog];
}

- (void)onServerCallLogReceived:(NCCallServerCallLogReceivedEvent *)event {
[self upsertServerCallHistoryMessage:event.callLog];
}

@end

Map NCCallLog to a chat message

Objective C
- (void)insertLocalSummaryMessage:(NCCallLog *)callLog {
NSString *summary = [self summaryFromCallLog:callLog];

// Replace this with your Chat SDK or Chat Kit write logic
[self.chatRepository insertCallSummaryWithCallId:callLog.callId
content:summary
timestamp:callLog.endTime];
}

- (NSString *)summaryFromCallLog:(NCCallLog *)callLog {
NSString *mediaText =
callLog.mediaType == NCCallMediaTypeAudioVideo ? @"Video call" : @"Audio call";

if (callLog.duration > 0) {
return [NSString stringWithFormat:@"%@ %ld seconds", mediaText, (long)callLog.duration];
}

return [NSString stringWithFormat:@"%@, ended: %ld", mediaText, (long)callLog.endReason];
}

Recommendations

  • If you need to show a summary in the current conversation immediately after the call ends, prefer onLocalCallLogReceived:.
  • If you need the final record to stay consistent across devices, prefer onServerCallLogReceived:.
  • If the conversation UI needs to distinguish incoming, outgoing, or group calls, combine callDirection with callType.