Closed finexusCriss closed 10 months ago
@finexusCriss Thanks for submitting your question. Can you provide all of the sample code package into a sample app? We'll try to reproduce the issue and investigate further.
Thank you for your reply, heres the sample app in React Native: https://github.com/finexusCriss/rnlivenesssampleapp
A standard
yarn install
npx pod-install ios
and opening the .xcworkspace file in XCode will do
@phantumcode Would like to check if there's any update on this issue, thank you!
@finexusCriss Apologies for the slow response, I was able to reproduce the issue but haven't been able to determine root cause. It is likely an integration between the native camera view with react native. I will continue to investigate further and provide additional updates when they're available.
Thank you so much for looking into the demo app, and glad that the issue is reproducible, looking forward to your update and solutions
@finexusCriss It doesn't appear to be a bug or issue with Liveness library. I was able to reproduce it by attempting to integrate with a basic camera view controller written from scratch.
I was able to resolve the issue by updating the LivenessViewManager
to the folllowing code snippet:
@objc(LivenessViewManager)
class LivenessViewManager: RCTViewManager {
let awsLivenessViewVC = UIHostingController(rootView: AWSFaceLivenessView())
let rootViewController = RCTPresentedViewController()
override var methodQueue: DispatchQueue! {
return DispatchQueue(label: "com.amazonaws.faceliveness.cameracapturequeue")
}
override static func requiresMainQueueSetup() -> Bool {
return true
}
override func view() -> UIView! {
return awsLivenessViewVC.view
}
@objc(presentViewController)
func presentViewController() {
self.rootViewController?.present(self.awsLivenessViewVC, animated: true, completion: nil)
}
}
Thank you so much for helping to look into the issue! I am able to use resolve the issue by using your updated code for LivenessViewManager
, never thought of putting the UIHostingController in presentViewController will cause such an issue, thanks again!
I'm trying to bridge the Swift Liveness to React Native, the instruction screen is successfully shown, but at the camera page, a dot is shown, but the camera preview is completely not showing, and the cross button is showing up
I have updated the IAM Role Permissions for the unauth role, but the result is still the same.
Below is my source code for the bridging from Swift to React Native AWSFaceLivenessView.swift
Wrapping it in a view controller: AWSLivenessViewController.swift
The view manager: LivenessViewManager.swift
LivenessViewManager.m
I have tested it in Swift, and it is working as expected, but when bridged to React Native, it is having the camera view black screen with only the cross button shown as in screenshot above. The error message received is: Error: Transpose unit is not supported. Socket SO_ERROR [54: Connection reset by peer] SocketStream read error [0x283544d20]: 1 54
Another thing I noticed is for the working one in Swift, the IAM Role has a last activity shown, while the not working on in React Native has no last activity shown.
Has been searching for solutions for days but still result in the same black screen of camera page, would be appreciate if any hint or sample code for how to bridge from Swift to React Native can be provided. Thank you!