Skip to main content

Overview

Document verification enables you to capture and verify various identity documents through the MetaMap iOS SDK. The SDK includes intelligent features like automatic document capture, face detection, and country-specific validation.

Supported Document Types

National ID

Government-issued national identity cards with support for front and back capture

Passport

International passports with machine-readable zone (MRZ) extraction

Driver's License

Driver’s licenses with automatic front and back side detection

Proof of Residency

Utility bills, bank statements, and other address verification documents

Key Features

Smart Document Capture

The SDK includes Vision-based smart capture that automatically detects document edges and captures when the document is properly positioned.
// Initialize MetaMap with your credentials
MetaMap.shared.showMetaMapFlow(
    clientId: "YOUR_CLIENT_ID",
    flowId: "YOUR_FLOW_ID",
    metadata: [:]
)

Face Detection on Documents

Automatic face detection helps validate documents with photos, ensuring the document contains a clear, visible face image.
Face detection on documents is performed on the mobile device for improved privacy and faster processing.

Document Subtypes

The SDK supports multiple document subtypes, allowing users to select specific document categories:
  • National ID cards
  • Voter ID
  • Residence permits
  • Tax ID documents
  • And more region-specific document types

PDF Support

For proof of residency and other documents, the SDK supports uploading multi-page PDF files.
Multi-page PDF uploads are supported for document verification steps, making it easier for users to submit utility bills and bank statements.

Country Restrictions

Document verification can be configured with country restrictions to limit which documents are accepted based on the issuing country.

How Country Restrictions Work

  • Configure allowed countries in your MetaMap flow settings
  • Users see only permitted countries in the document selection
  • Country selection is not pre-selected by default
  • Prevents submission of documents from restricted regions
// Country restrictions are configured in your flow settings
// No additional code required in the SDK implementation
MetaMap.shared.showMetaMapFlow(
    clientId: "YOUR_CLIENT_ID",
    flowId: "YOUR_FLOW_ID",
    metadata: [:]
)

Document Occlusion Detection

The SDK handles document occlusion errors, detecting when parts of the document are covered or obscured during capture.

Skip Document Options

Depending on your flow configuration, users may have the option to skip certain document captures or go back to re-capture:
  • Skip back side capture for specific document types
  • Skip optional document steps
  • Re-capture if the document quality is insufficient

Implementation Example

Swift Implementation

import UIKit
import MetaMapSDK

class DocumentVerificationViewController: UIViewController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        setupMetaMap()
    }
    
    private func setupMetaMap() {
        // Set delegate to receive results
        MetaMapButtonResult.shared.delegate = self
        
        // Start document verification flow
        MetaMap.shared.showMetaMapFlow(
            clientId: "YOUR_CLIENT_ID",
            flowId: "YOUR_FLOW_ID",
            metadata: [:]
        )
    }
}

extension DocumentVerificationViewController: MetaMapButtonResultDelegate {
    
    func verificationSuccess(identityId: String?, verificationID: String?) {
        print("Document verification completed: \(identityId ?? "")")
        // Handle successful verification
    }
    
    func verificationCancelled() {
        print("Document verification cancelled")
        // Handle cancellation
    }
}

Required Permissions

Document verification requires camera and photo library permissions. Add these keys to your Info.plist:
<key>NSCameraUsageDescription</key>
<string>MetaMap needs access to your Camera</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>MetaMap needs access to your media library</string>

Regional Support

Brazilian Driver’s License

Special handling for Brazilian driver’s licenses with support for:
  • Front and back side capture
  • Automatic back side skip when not required
  • CPF validation integration

LATAM and Africa Document Types

Extended support for region-specific document subtypes commonly used in Latin America and African countries.

Best Practices

  1. Clear Instructions: Ensure users understand which document type to select
  2. Good Lighting: Encourage users to capture documents in well-lit environments
  3. Country Configuration: Set appropriate country restrictions for your use case
  4. Error Handling: Implement proper error handling for document capture failures
  5. Re-verification: Use the identityId metadata parameter for re-verification flows
// Re-verification with existing identity
MetaMap.shared.showMetaMapFlow(
    clientId: "YOUR_CLIENT_ID",
    flowId: "YOUR_FLOW_ID",
    metadata: ["identityId": "existing_identity_id"]
)

Troubleshooting

Document Upload Issues

If users experience document upload problems:
  • Check network connectivity
  • Verify image file size is within limits
  • Ensure proper permissions are granted
  • Check for document occlusion or poor lighting

Country Selection Issues

If country selection isn’t working as expected:
  • Verify country restrictions are properly configured in your flow
  • Ensure the supported country list includes intended countries
  • Check that country data is loading from the server

Version History

  • v3.22.5: Fixed Brazilian driver’s license upload issue
  • v3.20.1: Added multi-page PDF upload support
  • v3.15.6: Added document occlusion error handling and face detection
  • v3.14.0: Added smart capture feature (Vision)
  • v3.9.5: Added document subtypes and skip back functionality

Build docs developers (and LLMs) love