Skip to content

[BR] Incorrect types for expectedPass on iOS #22

@Watersdr

Description

@Watersdr

Before Submitting, be sure to

  • Update to the latest stable version.
  • Read and follow the guides described in the documentation.
  • Try to reproduce in our demo project.
  • Search for your issue in the existing GitHub issues.

Bug Description

Incorrect types for expectedPass on iOS. The variables defined on eImageQualityCheckType that are shown in the documentation examples are typed incorrectly for the iOS library. The variables in JS are defined as numbers but iOS expects them as strings

Steps To Reproduce

Try to setup your document scan config using the exact example from the docs and your app will crash because the parameters are incorrect.

DocumentReader.setProcessParams({
    imageQA: {
        expectedPass: [
            eImageQualityCheckType.IQC_IMAGE_RESOLUTION,
            eImageQualityCheckType.IQC_IMAGE_GLARES
        ]
    }
}, (str) => { console.log(str) }, (error) => { console.log(error) });

I attempted to use the getTranslation method but that method expects a callback which is just completely unnecessary for doing a simple number to string mapping. I think the iOS native code needs to be update to accept the number type like the docs show. Or you could do the mapping on the JS side. Or even just define the string versions of the eImageQualityCheckType in JS and let the consumer do their own mappings.

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