UserDetailsProvider
@available(iOS 12.0, *)
@objc(BDKUserDetailsProvider)
public protocol UserDetailsProvider
Classes conforming to this protocol serve the purpose of providing UserDetails
objects and CallKit CXHandle
objects to the Kaleyra Video SDK when it needs to display information regarding a particular user of your system to the app user.
For example the SDK might ask user information when it must update the user interface when an outgoing call is being performed.
Kaleyra Video does not own user information like user’s first name, last name, email addresses and so on.
It is hosting app responsibility to provide those information through this protocol.
Important
Classes implementing this protocol must be thread safe, the protocol methods might be invoked concurrently on a background system queue. You should take this into account if you are going to fetch user information from a component which is not inherently thread safe.-
This method will be invoked when user details are needed by the Kaleyra Video SDK.
Beware, this method might be invoked an a background system queue, and you should invoke the closure provided within a short period of time (a bunch of seconds), otherwise the values provided might be ignored and default values might be used instead. Beware this method might be invoked on a background system queue, you should take that into account if you were to fetch the information needed to create the
UserDetails
objects from a component or a system that has threading concerns (e.g. CoreData).Declaration
Swift
func provideDetails(_ userIds: [String], completion: @escaping ([UserDetails]) -> Void)
Parameters
userIds
An array containing the user ids for which profile information are going to be needed by the Kaleyra Video SDK
completion
A closure you must call must call when user details have been fetched.
-
This method will be called whenever a
CXHandle
must be created for the userIds provided as first argument.CXHandle
objects belongs toCallKit
framework and are used by the system to identify a user in the phone AddressBook. In other words, during a phone call these handles are used by the operating system to identify the caller or the callees by their phone number, email address or any other mean. Whenever an incoming call is received or an outgoing call is started, CallKit must know which recipients it must refer to, in order to show the caller or the callees information on the system UI. If you were to enable Kaleyra Video’sCallKit
support, you must implement this method. Eventually the Kaleyra Video SDK will call this method whenever aCXHandle
must be created for the userIds provided as argument. You should create aCXHandle
object a return it in the closure provided as second argument. You should invoke the closure provided as second parameter within a short period of time (a bunch of seconds), otherwise the values provided might be ignored and default values might be used instead.Remark
Beware this method might be invoked on a background system queue, you should take that into account if you were to fetch the information needed to create the
CXHandle
object from a component or a system that has threading concerns (e.g. CoreData).Declaration
Swift
func provideHandle(_ userIds: [String], completion: @escaping (CXHandle) -> Void)
Parameters
userIds
An array containing the user ids for which a
CallKit
CXHandle
is going to be needed by the Kaleyra Video SDK.completion
A closure you must call when a
CXHandle
has been created.