RFSFaceSDK

Objective-C


@interface RFSFaceSDK : NSObject

Swift

class FaceSDK : NSObject

The entry point to the Face SDK features.

  • A shared instance of RFSFaceSDK.

    Declaration

    Objective-C

    @property (class, nonatomic, strong, readonly, nonnull) RFSFaceSDK *service;

    Swift

    class var service: FaceSDK { get }
  • An URL of your web service instance.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) NSString *serviceURL;

    Swift

    var serviceURL: String? { get set }
  • The Face SDK version.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly, nullable) NSString *version;

    Swift

    var version: String? { get }
  • A localization hook to override default localization search logic. If this block is not set or the implementation of the block returns nil the default localization will be used.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) NSString *_Nullable (^) (NSString *_Nonnull) localizationHandler;

    Swift

    var localizationHandler: ((String) -> String?)? { get set }
  • Delegate that responds to request intercepting events. Use the delegate to modify URLRequest requests before they are send to the web service.

    Declaration

    Objective-C

    @property (nonatomic, weak, nullable) id<RFSURLRequestInterceptingDelegate> requestInterceptingDelegate;
  • Delegate that informs about the successfull upload of the video.

    Declaration

    Objective-C

    @property (nonatomic, weak, nullable) id<RFSVideoUploadingDelegate> videoUploadingDelegate;

    Swift

    weak var videoUploadingDelegate: VideoUploadingDelegate? { get set }
  • Undocumented

    Declaration

    Objective-C

    - (void)initializeWithCompletion:(RFSFaceInitializationCompletion _Nonnull)completion NS_SWIFT_NAME(initialize(completion:));

    Swift

    func initialize() async throws -> Bool
  • Processes given RFSMatchFacesRequest and calls back the completionHandler block when finished.

    Declaration

    Objective-C

    - (void)matchFaces:(nonnull RFSMatchFacesRequest *)request
            completion:(void (^_Nonnull)(RFSMatchFacesResponse *_Nonnull))
                           completionHandler;

    Swift

    func matchFaces(_ request: RFSMatchFacesRequest) async -> RFSMatchFacesResponse

    Parameters

    request

    Processing request.

    completionHandler

    Completion block to call when request is finished processing.

  • Presents a liveness view controller.

    Declaration

    Objective-C

    - (void)startLivenessFrom:(nonnull UIViewController *)presenting
                     animated:(BOOL)animated
                configuration:(nullable RFSLivenessConfiguration *)configuration
                   onLiveness:
                       (nullable void (^)(RFSLivenessResponse *_Nonnull))onLiveness
                   completion:(nullable void (^)(void))completion;

    Swift

    func startLiveness(from presenting: UIViewController, animated: Bool, configuration: RFSLivenessConfiguration?, onLiveness: ((RFSLivenessResponse) -> Void)?) async

    Parameters

    presenting

    The UIViewController that will present the liveness view controller.

    animated

    Pass true to animate the presentation otherwise, pass false.

    onLiveness

    Liveness response.

    configuration

    Configuration object. Falls back to the default configuration when nil.

    completion

    Presentation transition completion block.

  • Presents a liveness view controller

    Declaration

    Objective-C

    - (void)startLivenessFrom:(nonnull UIViewController *)presenting
                     animated:(BOOL)animated
                   onLiveness:
                       (nullable void (^)(RFSLivenessResponse *_Nonnull))onLiveness
                   completion:(nullable void (^)(void))completion;

    Swift

    func startLiveness(from presenting: UIViewController, animated: Bool, onLiveness: ((RFSLivenessResponse) -> Void)?) async

    Parameters

    presenting

    The UIViewController that will present the liveness view controller.

    animated

    Pass true to animate the presentation otherwise, pass false.

    onLiveness

    Completion block to call when the liveness is finished processing.

    completion

    Presentation transition completion block.

  • Stops the liveness processing and closes the view controller.

    Declaration

    Objective-C

    - (void)stopLivenessProcessing;

    Swift

    func stopLivenessProcessing()
  • Processes given request and calls back the completionHandler block when finished. Requires network connection.

    Declaration

    Objective-C

    - (void)detectFacesByRequest:(nonnull RFSDetectFacesRequest *)request
                      completion:(nonnull void (^)(
                                     RFSDetectFacesResponse *_Nonnull))completion;

    Swift

    func detectFaces(by request: RFSDetectFacesRequest) async -> RFSDetectFacesResponse

    Parameters

    request

    Processing request.

    completion

    Completion block to call when request is finished processing.

  • Presents face capturing view controller

    Declaration

    Objective-C

    - (void)
        presentFaceCaptureViewControllerFrom:(nonnull UIViewController *)presenting
                                    animated:(BOOL)animated
                               configuration:
                                   (nullable RFSFaceCaptureConfiguration *)
                                       configuration
                                   onCapture:(nullable void (^)(
                                                 RFSFaceCaptureResponse *_Nonnull))
                                                 onCapture
                                  completion:(nullable void (^)(void))completion;

    Swift

    func presentFaceCaptureViewController(from presenting: UIViewController, animated: Bool, configuration: RFSFaceCaptureConfiguration?, onCapture: ((RFSFaceCaptureResponse) -> Void)?) async

    Parameters

    presenting

    The UIViewController that will present face capturing view controller

    animated

    Pass true to animate the presentation otherwise, pass false.

    configuration

    Configuration object. Falls back to the default configuration when nil.

    onCapture

    Completion block to call when the face capture is finished processing.

    completion

    Presentation transition completion block.

  • Presents a face capturing view controller

    Declaration

    Objective-C

    - (void)
        presentFaceCaptureViewControllerFrom:(nonnull UIViewController *)presenting
                                    animated:(BOOL)animated
                                   onCapture:(nullable void (^)(
                                                 RFSFaceCaptureResponse *_Nonnull))
                                                 onCapture
                                  completion:(nullable void (^)(void))completion;

    Swift

    func presentFaceCaptureViewController(from presenting: UIViewController, animated: Bool, onCapture: ((RFSFaceCaptureResponse) -> Void)?) async

    Parameters

    presenting

    The UIViewController that will present face capturing view controller

    animated

    Pass true to animate the presentation otherwise, pass false.

    onCapture

    Completion block to call when the face capture is finished processing.

    completion

    Presentation transition completion block.

  • Stops the face capturing and closes the view controller.

    Declaration

    Objective-C

    - (void)stopFaceCaptureViewController;

    Swift

    func stopFaceCaptureViewController()
  • FaceSDK deinitialization.

    Declaration

    Objective-C

    - (void)deinitialize;

    Swift

    func deinitialize()