Skip to content
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

[iOS]Camera permission error occurs when entering the background #166

Closed
hyunseokYang opened this issue Aug 7, 2024 · 3 comments
Closed
Labels
bug Something isn't working

Comments

@hyunseokYang
Copy link

hyunseokYang commented Aug 7, 2024

Describe the bug

Hello.
I'm inquiring about an error while testing this package in iOS.

in FaceLivenessDetectorView,
After reaching the DisplayState.displayingLivense state
When the app is inactive (or background)
FaceLivenessDetectionError(code: 5, message: "Camera permissions have not been granted.", recoverySuggestion: "Prompt the user to grant camera permission.") An error occurs.


My example code
...
...

FaceLivenessDetectorView(
                sessionID: sessionId,
                region: region,
                isPresented: Binding(
                    get: { true },
                    set: { _ in }
                ),
                onCompletion: { result in
                    switch result {
                    case .success:
                        // success process
                    case .failure(let error):
                        /// Here !! error occurs
                    default:
                        // default process                 
                    }
                }
            )

Of course, the camera permission was already authorized.

Steps To Reproduce

Steps to reproduce the behavior:
1. FaceLivenessDetectorView show
2. Click on beginCheckButton
3. go to background
4. occurs error

Expected behavior

No error occurs

Swift Liveness Version

1.2.16

Xcode version

Version 15.2 (15C500b)

OS Version

iOS 15.7.1

Device

iPhone 12

@ruisebas ruisebas added the bug Something isn't working label Aug 8, 2024
@ruisebas
Copy link
Member

ruisebas commented Aug 8, 2024

Hi @hyunseokYang, thanks for opening this issue.
The team will take a look and post updates here.

@ruisebas
Copy link
Member

This has been fixed in version 1.3.1: moving the app to the background during a liveness check now results in a .userCancelled error.
Please update your dependency.

Thanks!

Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants