-
Notifications
You must be signed in to change notification settings - Fork 10
Description
Message type: OPEN_OCR_SCANNER
Originator: Web
Min app version: 26.0
Description
This method will open a native screen containing an OCR scanner that will look for a text matching a given format. When a text is found, the native screen will be closed and it will be returned as a result to the Web. The first text found that matches the given pattern will be returned.
It will only be available in Mein Blau and Mein O2.
Differences between iOS/Android (if any)
Required permissions in Android
<uses-permission android:name="android.permission.CAMERA"/>Required permissions in iOS
The following entry is required in Info.plist
<key>NSCameraUsageDescription</key>
<string>Esta aplicación necesita acceso a la cámara para escanear y reconocer texto en imágenes</string>Payload definition
Request Payload
Right now the OCR only needs to scan a particular formatted text but it would be nice to allow more than one supported format.
regex: string | nullExamples:
Following example will open the scanner and it will try to scan a text with the format 1111-1111-1111-1111.
{"type": "OPEN_OCR_SCANNER", "id": "web-2", "payload": {"regex": "\b(?:\d{4}-\d{4}-\d{4}-\d{4}|\d{16})\b"}}Response Payload
Nullable scannedText because user may close the scanner before letting it find any text.
scannedText: string | null;Examples:
{"type": "OPEN_OCR_SCANNER", "id": "web-2", "payload": {"scannedText": "1234-5678-8765-4321"}}Possible error cases
Include codes and description messages. Also explain when they can occur if
necessary.
401 → Missing permissions
405 -> Feature not supported in current brand
500 -> Internal error (e.g.: Unexpected error thrown by native scanner)