BDKUserDetailsProvider
Objective-C
@protocol BDKUserDetailsProvider
Swift
protocol UserDetailsProvider
Classes confomring to this protocol serve the purpose of providing BDKUserDetails
objects and CallKit CXHandle
objects
to the BandyerSDK 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.
Bandyer does not own user information like user’s first name, last name, email addresses and so on.
It is BandyerSDK app host responsibility to provide those information through this protocol.
Remark: 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 BandyerSDK. Beware, this method might be invoked an a background system queue, an it should invoke the completion block provided within a short period of time (less than half of a second), 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
BDKUserDetails
objects from a component or a system that has threading concerns (e.g. CoreData).Declaration
Objective-C
- (void)provideDetails:(nonnull NSArray<NSString *> *)aliases completion:(nonnull void (^)(NSArray<BDKUserDetails *> *_Nonnull)) completion;
Swift
func provideDetails(_ aliases: [String]) async -> [BDKUserDetails]
Parameters
aliases
An array containing the user aliases for which profile information are going to be needed by the BandyerSDK.
completion
A completion block that must be called when user details have been fetched.
-
This method will be called whenever a
CXHandle
must be created for the aliases provided as first argument. You should create aCXHandle
object a return it in the completion block provided as second argument. Beware, this method might be invoked an a background system queue, an it should invoke the completion block provided within a short period of time (less than half of a second), 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 theCXHandle
object from a component or a system that has threading concerns (e.g. CoreData).CXHandle
objects belongs toCallKit
framework and are used by the system to identify a user in the phone AddressBook, in other words in 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 BandyerSDK’sCallKit
support, you must implement this method. Eventually the BandyerSDK will call this method whenever aCXHandle
must be created for the aliases provided.Declaration
Objective-C
- (void)provideHandle:(nonnull NSArray<NSString *> *)aliases completion:(nonnull void (^)(CXHandle *_Nonnull))completion;
Swift
func provideHandle(_ aliases: [String]) async -> CXHandle
Parameters
aliases
An array containing the user aliases for which a
CallKit
CXHandle
is going to be needed by the BandyerSDK.completion
A completion block that must be invoked when a
CXHandle
has been created.