How to add display name for the incoming call with out SDK call kit enabled.

Parashivappa, Niranjanprasad 0 Reputation points
2023-08-01T12:54:16.7366667+00:00

Working video call- How to add display name for the incoming call with out SDK call kit enabled. Can you provide more info on this.

Azure Communication Services
Azure Communication Services
An Azure communication platform for deploying applications across devices and platforms.
684 questions
{count} votes

1 answer

Sort by: Most helpful
  1. brtrach-MSFT 15,256 Reputation points Microsoft Employee
    2023-08-01T23:10:48.9633333+00:00

    @Parashivappa, Niranjanprasad To add a display name for incoming calls without using the CallKit SDK, you can use the CallerInfo object. The CallerInfo object contains information about the caller, including their display name. Here's an example of how to use it:

    <span class=" active-doc-1" data-doc-items="1">let call = // get the incoming call object[2](#doc-pos=1)</span>
    
    if let callerInfo = call.callerInfo {
        let displayName = callerInfo.displayName ?? "Unknown Caller"
        print("Incoming call from \(displayName)")
    } else {
        print("Incoming call from unknown caller")
    }
    
    
    

    In this example, we first check if the callerInfo property of the incoming call object is not nil**1**. If it's not nil, we get the display name from the displayName property of the CallerInfo object. If the displayName property is nil, we use a default value of "Unknown Caller". If the callerInfo property is nil, we print a message indicating that the call is from an unknown caller.

    Note that this approach does not provide the same level of integration with the system as the CallKit SDK, so the display name may not be shown in the same way as it would be with the SDK.

    0 comments No comments