diff --git a/caf-src/android/CafFaceLivenessActivity.java b/caf-src/android/CafFaceLivenessActivity.java index 7a219b2..aae758d 100644 --- a/caf-src/android/CafFaceLivenessActivity.java +++ b/caf-src/android/CafFaceLivenessActivity.java @@ -38,13 +38,9 @@ protected void onCreate(Bundle savedInstanceState) { } private void faceLiveness() throws JSONException { - FaceLivenessConfig config = new FaceLivenessConfig(customConfig); FaceLiveness faceLiveness = new FaceLiveness.Builder(token) - .setStage(config.cafStage) - .setFilter(config.filter) - .setEnableScreenshots(config.setEnableScreenshots) - .setLoadingScreen(config.setLoadingScreen) + .setFilter(Filter.NATURAL) .build(); faceLiveness.startSDK(this, personId, new VerifyLivenessListener() { diff --git a/caf-src/ios/CafFaceLiveness.swift b/caf-src/ios/CafFaceLiveness.swift index a18a8da..0c60a04 100644 --- a/caf-src/ios/CafFaceLiveness.swift +++ b/caf-src/ios/CafFaceLiveness.swift @@ -40,7 +40,7 @@ class CafFaceLiveness: RCTEventEmitter, FaceLivenessDelegate { func faceLiveness(token: String, personId: String, config: String) { var configDictionary: [String: Any]? = nil var filter = Filter.lineDrawing; - var cafStage = FaceLiveness.CAFStage.PROD + var cafStage = FaceLiveness.CAFStage.prod var setLoadingScreen:Bool? = nil; if let data = config.data(using: .utf8) { @@ -63,40 +63,32 @@ class CafFaceLiveness: RCTEventEmitter, FaceLivenessDelegate { .setStage(stage: cafStage) .setFilter(filter: filter) .setLoadingScreen(withLoading: setLoadingScreen!) - .setCredentials(mobileToken: token, personId: personId) .build() faceLiveness.delegate = self DispatchQueue.main.async { guard let currentViewController = UIApplication.shared.keyWindow!.rootViewController else { return } - faceLiveness.startSDK(viewController: currentViewController) + faceLiveness.startSDK(viewController: currentViewController, mobileToken: token, personId: personId) } } // FaceLiveness - func didFinishLiveness(with faceLivenessResult: FaceLiveness.FaceLivenessResult) { + func didFinishLiveness(with livenessResult: LivenessResult) { let response : NSMutableDictionary = [:] - response["data"] = faceLivenessResult.signedResponse + response["data"] = livenessResult.signedResponse sendEvent(withName: "FaceLiveness_Success", body: response) } - func didFinishWithFail(with faceLivenessFailResult: FaceLiveness.FaceLivenessFailResult) { - let response : NSMutableDictionary = [:] - response["message"] = faceLivenessFailResult.description - response["type"] = String(describing: faceLivenessFailResult.failType) - response["data"] = String(describing: faceLivenessFailResult.signedResponse) - sendEvent(withName: "FaceLiveness_Error", body: response) - } - func didFinishWithCancelled(with faceLivenessResult: FaceLiveness.FaceLivenessResult) { + func didFinishWithCancelled() { sendEvent(withName: "FaceLiveness_Cancel", body: nil) } - func didFinishWithError(with faceLivenessErrorResult: FaceLiveness.FaceLivenessErrorResult) { + func didFinishWithError(with sdkFailure: SDKFailure) { let response : NSMutableDictionary = [:] - response["message"] = faceLivenessErrorResult.description - response["type"] = String(describing: faceLivenessErrorResult.errorType) + response["message"] = sdkFailure.description + response["type"] = String(describing: sdkFailure.errorType) sendEvent(withName: "FaceLiveness_Error", body: response) } @@ -115,4 +107,5 @@ class CafFaceLiveness: RCTEventEmitter, FaceLivenessDelegate { func closeLoadingScreenValidation() { sendEvent(withName: "FaceLiveness_Loaded", body: nil) } + func onConnectionChanged(_ state: FaceLiveness.LivenessState) {} }