-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Amplify Liveness intermitently does not ask for Camera Permission on FireFox mobile (iOS & Android) #5847
Comments
@paternina What version of Firefox mobile are you using and what's your OS version? |
Is Firefox Mobile 130.0.1 and we used iOS 18 but we have the same behavior in Android 13 |
When you say FireFox Mobile, you mean Firefox for iOS and Firefox for Android, right? |
That's right |
What version of the ui-react-liveness package are you using? |
We have the following: "@aws-amplify/ui-react": "^6.5.1", |
Hi @Tyg0th, Any other patterns of when this happens you can think of that might help us narrow this down? |
@Tyg0th are you using |
Hi @reesscot it fails intermittently sometimes ask for permissions and sometimes it does not, the only difference from our code and the one shared in the documentation is that we are using a check camera utility function before showing the component useEffect(() => {
const checkCamera = async () => {
const cameraExist = await detectWebcam();
setDeviceHasCamera(cameraExist); // if false show an error message and does not load the component
};
checkCamera();
}, []); This is just a JavaScript function that check if customer have a camera. export const detectWebcam = async () => {
let md = navigator.mediaDevices;
if (!md || !md.enumerateDevices){
return false;
}
try {
const devices = await md.enumerateDevices();
return devices.some(device => device.kind === "videoinput");
} catch (error) {
console.error('Error enumerating devices: ', error);
return false;
}
}; It may responde your question @esauerbo , we are using As you may noticed, the FaceLivenessDetector component is loaded and is always showing the waitingCameraPermissionText script. |
@paternina just for reference, we perform a similar check in the component to make sure that a customer has a valid video devices - https://github.com/aws-amplify/amplify-ui/blob/main/packages/react-liveness/src/components/FaceLivenessDetector/service/machine/machine.ts#L961 However we also have a simple check for virtual cameras as the Rekognition services want to avoid the usage of virtual cameras when possible to help avoid fraud. |
Hi @thaddmt Thank you for the reference! I’d like to clarify my understanding: it seems that this implementation only checks if the user has a virtual camera device and then throws an error. The error returned should be handled by the Additionally, please note that the FaceLivenessDetector component is being displayed but is always showing the "waiting for camera permission" text, so I am not sure if the issue is related to the To provide more context, the main issue we're encountering is that when customers visit our site for the first time using Firefox for Android and Firefox for iOS, it correctly requests camera access, and everything works as expected. However, on subsequent visits (the second or third time), the component fails to load even though permissions are granted. Currently, the only workaround is to clear all site permissions and start fresh. |
@paternina the component throws an error if there are only non virtual cameras available, but it also checks for a few other constraints like frame rate and video width/height. Otherwise that's correct. Are you still able to reproduce this behavior if you remove the |
Hi @esauerbo Unfortunately I cannot share a public repository, it is a private work and company does not allow us to share it, but, the component is exactly like shared above, and I also shared the detectWebcam logic. I removed the detectWebcam logic and the issue persist, it request access to camera once, but subsequent visits do not request it. |
@paternina Can you share what you are using in the screenshot to debug? Are you using the camera anywhere else in your app which might be preventing the Liveness component from using it? In the screenshot I see the log message "Stopping active stream on Back Triple Camera". The Liveness component doesn't support using the back cameras, on the forward/user facing cameras. ![]() |
Hi @reesscot , yes we use a component to capture the user document (KYC flow) before the liveness process, it uses another package and a custom fallback option when customer device does not meet the minimum requirements for the first one. However, this step is completed successfully and then pass to LivenessDetector. |
@paternina That's good information, thanks for sharing. My suspicion is that your other component is not releasing the video stream, which is causing the Liveness component to be unable to access the camera. Can you try replacing the Liveness component with a getUserMedia call using the Liveness default constraints? |
@paternina, wanted to circle back and see if you tried the suggestion above. Let us know if you've had a chance to replace the Liveness component with a getUserMedia call using the Liveness default constraints? |
We have had a similar issue reported by a client. They are using Firefox version 133.0.2, Android version 14, Samsung Galaxy A53. When they switch over to Chrome it works as expected. When the user loads the liveness page there is no prompt asking to use the camera. We get the below error
Manually changing the camera permissions (and all other media permissions) for our website to allowed, we see the same issue. Using BrowserStack to test on different devices, we can replicate the issue on additional devices, a Samsung A51, A52 using Firefox (stopped testing on other Samsung devices at this point). Looking at your above mentioned recommendations of using getUserMedia call using the Liveness default constraints in place of the liveness component, we can see that there is no prompt asking for camera permissions when using Firefox on a Samsung A52 device. Changing the Liveness default constraints to something like Testing liveness on Firefox on my device, Android 14, Samsung Galaxy S23 Ultra it works as expected (additionally the getUserMedia query with the Liveness default constraints works) and I get the prompt to enable camera permissions, the issue seems to be related to the model of the mobile. Using:
Let me know if you require any more details to look into this issue further for us, thanks |
@gary-hodgson-infotrack, thanks for the testing and response here. It may be that this is a Firefox specific issue, but we're going to try and reproduce this internally and follow up. |
@cwomack do you have any updates on this issue raised by Gary from our team. The client has reached out that this is still an issue with the specific firefox version on the device Android version 14, Samsung Galaxy A53. |
@swathimaddali-infotrack, thanks for the additional info from the client. Is there a way to confirm if this is experienced on later version of Firefox as well? Or has this been pinned down to only occur with this specific version (or specifically the combination of the Firefox version and the Android device)? Trying to see if this is isolated to that combo or if it's impacting other devices outside the Samsung A52/53's. Basically, want to ask either you or the client to use the latest version of Firefox and confirm if the behavior continues. |
@cwomack Just to add some more information. We tried using android studio - virtual device with same exact firefox version and Android 14, and it works great. But unfortunately we cannot get the Samsung A series to test directly. I wonder whether that's device specific issue or not. |
@IvanWijayaInfoTrack and anyone else following this thread, thank you for the additional information. We're investigating this issue and looking for ways to be able to reproduce this on our end. We'll be sure to follow up with another comment if we can identify the root cause. |
Thank you @tiffanynwyeung . |
Before creating a new issue, please confirm:
On which framework/platform are you having an issue?
React
Which UI component?
Liveness
How is your app built?
Vite
What browsers are you seeing the problem on?
Firefox
Which region are you seeing the problem in?
us-east-1
Please describe your bug.
Sometimes the package does not ask for camera permission on Firefox mobile, and keep on an infinite loop displaying the waitingCameraPermissionText.
Please note that it is intermittent, sometimes works, sometimes does not but it fails in most cases. It works fine on Firefox for desktop and other browsers, the issue is only on Firefox mobile.
What's the expected behaviour?
We should see a pop up requesting the camera access permission or display the component on the screen.
Help us reproduce the bug!
Code Snippet
Console log output
No console error, the request to create the session ID is OK.
Additional information and screenshots
The text was updated successfully, but these errors were encountered: