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 or IMKit, 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 IMKit so the conversation view refreshes.

Callbacks for conversation UI

NCCallEventDelegate currently exposes two call log related events:

CallbackDescription
didLocalCallLogReceived:Locally generated 1-to-1 call summary. Best for immediate display.
didServerCallLogReceived:Final server-generated call log. Best for sync and history display.

Useful NCCallLog fields

NCCallLog currently exposes these commonly used properties:

  • callId
  • callType
  • mediaType
  • callerUserId
  • participants
  • duration
  • endReason
  • callDirection
  • startTime
  • endTime
  • syncTime
Objective C
@interface MyCallHandler () <NCCallEventDelegate>
@end

@implementation MyCallHandler

- (void)didLocalCallLogReceived:(NCCallLog *)callLog {
[self insertLocalSummaryMessage:callLog];
}

- (void)didServerCallLogReceived:(NCCallLog *)callLog {
[self upsertServerCallHistoryMessage: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 IMKit write logic
[self.chatRepository insertCallSummaryWithCallId:callLog.callId
content:summary
timestamp:callLog.endTime];
}

- (NSString *)summaryFromCallLog:(NCCallLog *)callLog {
NSString *mediaText =
callLog.mediaType == NCCallAudioVideoMediaType ? @"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 didLocalCallLogReceived:.
  • If you need the final record to stay consistent across devices, prefer didServerCallLogReceived:.
  • If the conversation UI needs to distinguish incoming, outgoing, or group calls, combine callDirection with callType.