BCXHandleProvider

Objective-C

@protocol BCXHandleProvider <NSObject, NSCopying>

Swift

protocol BCXHandleProvider : NSCopying, NSObjectProtocol

Objects conforming to this protocol are capable of converting user aliases (user ids) into a CXHandle object.

CXHandle objects belongs to CallKit framework and are used by the system as a mean by which a call recipient can be reached, in other words in a phone call these handles are used by the operating system to identify the caller or the callee 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 callee information on the system UI. If you were to enable CallKit, you should provide the sdk an object conforming to this protocol. That object will be called whenever a CXHandle must be created for the aliases provided.

See

CXHandle
  • This method will be called whenever a CXHandle must be created for the aliases provided as first argument. You should create a CXHandle object a return it in the completion block provided as second argument. Beware this method will be called from a background 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

    Objective-C

    - (void)handleForAliases:(nullable NSArray<NSString *> *)aliases
                  completion:(nonnull void (^)(CXHandle *_Nonnull))completion;

    Swift

    func handle(forAliases aliases: [String]?, completion: @escaping (CXHandle) -> Void)

    Parameters

    aliases

    The user aliases.

    completion

    a completion block that must be invoked when a CXHandle has been created.