Skip to main content
This quickstart guide will walk you through implementing a complete MetaMap verification flow in your iOS app using UIKit.

Prerequisites

Before starting, ensure you have:
  • Completed the Installation guide
  • Your MetaMap Client ID from the dashboard
  • Your Flow ID for the verification flow you want to use
  • Required permissions configured in Info.plist

Implementation Steps

1

Import MetaMap SDK

Open your ViewController.swift file and import the MetaMap SDK:
ViewController.swift
2

Setup MetaMap Button

Create and configure the MetaMap button in your view controller. Add this code to your ViewController class:
ViewController.swift
The MetaMapButton comes with default MetaMap branding. You can customize its appearance using metadata (see Customization below).
3

Launch Verification Flow

Add the action handler that launches the MetaMap verification flow when the button is tapped:
ViewController.swift
Replace YOUR_CLIENT_ID and YOUR_FLOW_ID with your actual credentials from the MetaMap dashboard.
4

Handle Verification Results

Implement the MetaMapButtonResultDelegate to handle verification callbacks:
ViewController.swift
Store the identityId and verificationID to check verification status on your backend or query the MetaMap API.

Complete Example

Here’s the complete working implementation:
ViewController.swift

Customization

The metadata parameter allows you to customize the SDK behavior and appearance:

Set Language

By default, the SDK uses English. You can set a fixed language:
Supported languages: en, es, fr, pt, ru, tr, de, it, pl, th

Customize Button Colors

Customize the button appearance to match your app’s design:

Re-verification Flow

For returning users, pass their existing identity ID:

Enable Encryption

For enhanced security, use an encryption configuration:

Custom Fonts

Use your app’s custom fonts (ensure font files are included in your project):

Testing Your Integration

1

Build and Run

Build and run your app on a physical iOS device (camera access is limited in simulator):
2

Grant Permissions

When prompted, allow camera, photo library, and microphone access.
3

Complete Verification

Tap the MetaMap button and complete the verification flow:
  • Follow the on-screen instructions
  • Capture required documents
  • Complete liveness check
  • Confirm submission
4

Check Results

Verify that your delegate methods are called:
  • Check console logs for success/cancellation messages
  • Verify you receive identityId and verificationID
Test on Physical Device: The verification flow requires camera access, which is not fully functional in the iOS Simulator. Always test on a real device.

Common Metadata Options

Here’s a comprehensive example with multiple metadata options:

Next Steps

SwiftUI Integration

Learn how to integrate with SwiftUI

Advanced Configuration

Explore advanced SDK configuration options

Handle Results

Learn how to process verification results

API Reference

View complete API documentation