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:
- Listen for
NCCallLogcallbacks after the call ends. - Map
NCCallLogto your own chat message model or recent conversation summary. - 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:
| Callback | Event type | Description |
|---|---|---|
onLocalCallLogReceived: | NCCallLocalCallLogReceivedEvent | Locally generated 1-to-1 call summary. Best for immediate display. |
onServerCallLogReceived: | NCCallServerCallLogReceivedEvent | Final server-generated call log. Best for sync and history display. |
Useful NCCallLog fields
NCCallLog exposes these commonly used properties:
callIdcallTypemediaTypecallerUserIdparticipantsdurationendReasoncallDirectionstartTimeendTimesyncTimecallStatecurrentUserStatecreationTime
Time-related fields use these units:
startTime,endTime,syncTime, andcreationTime: millisecondsduration: seconds
Recommended integration pattern
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
callDirectionwithcallType.