Skip to content

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

@hyunseokYang

Description

@hyunseokYang

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions