@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.