Overview
Themetadata parameter is an optional dictionary that allows you to customize the verification experience, pass additional data, and configure SDK behavior. Metadata can be used for UI customization, analytics tracking, user identification, and more.
Basic Usage
Metadata is passed as a dictionary when initializing the verification flow:Objective-C Example
Built-in Metadata Parameters
The MetaMap SDK recognizes several built-in metadata keys that control specific functionality:Language Configuration
Sets the SDK interface language. By default, the SDK uses English (
"en").Supported languages:"en"- English"es"- Spanish"fr"- French"pt"- Portuguese"ru"- Russian"tr"- Turkish"de"- German"it"- Italian"pl"- Polish"th"- Thai
UI Customization
Customizes the primary button color using hexadecimal color format.Format:
"#RRGGBB" (e.g., "#FF5733")Default: White ("#FFFFFF")Customizes the button text color using hexadecimal color format.Format:
"#RRGGBB" (e.g., "#000000")Default: Black ("#000000")Custom Fonts
Specifies a custom font file for regular text. The font file must be included in your app bundle.Format: Font filename with extension (e.g.,
"CustomFont-Regular.ttf")Specifies a custom font file for bold text. The font file must be included in your app bundle.Format: Font filename with extension (e.g.,
"CustomFont-Bold.ttf")To use custom fonts, ensure the font files are added to your Xcode project and included in the
Info.plist under the Fonts provided by application key.Re-verification
Links the verification session to an existing identity. Use this for re-verification scenarios when a user needs to update expired documents or provide additional information.The
identityId is returned in the verificationSuccess callback from previous verifications.Encryption Configuration
Specifies an encryption configuration ID for encrypting sensitive verification data. This provides an additional layer of security for highly sensitive applications.Encryption configurations are created in your MetaMap Dashboard.
Custom Metadata
Beyond the built-in parameters, you can pass any custom key-value pairs in metadata for your own tracking and analytics purposes. This data is stored with the verification session and can be retrieved via the MetaMap API.Common Use Cases
User Identification
Link verification to your internal user ID
Analytics Tracking
Track verification source, campaign, or referral
Session Context
Store timestamp, app version, or device info
Business Logic
Pass data for custom backend processing
Practical Examples
User Tracking
Analytics and Attribution
Session Information
Geographic Information
Complete Configuration Example
Here’s a comprehensive example combining multiple metadata parameters:Retrieving Metadata
Metadata passed during verification is stored with the verification session and can be retrieved:- Via MetaMap Dashboard: View metadata in the verification details
- Via MetaMap API: Fetch verification data including metadata
- Via Webhooks: Receive metadata in webhook payloads
Data Types and Limitations
Metadata values can be:- Strings: Text values
- Numbers: Integers and floating-point numbers
- Booleans: True/false values
- Nested dictionaries: For structured data
Best Practices
Keep Metadata Lean
Keep Metadata Lean
Only include data that’s necessary for your use case. Excessive metadata can increase payload size and slow down verification initialization.
Use Consistent Key Names
Use Consistent Key Names
Establish naming conventions for metadata keys and use them consistently across your app. This makes data retrieval and analysis much easier.
Validate Data Before Passing
Validate Data Before Passing
Ensure metadata values are in the correct format and non-null before passing to the SDK. Invalid data can cause unexpected behavior.
Document Your Custom Metadata
Document Your Custom Metadata
Maintain documentation of which metadata keys your app uses and what they represent. This is especially important for team projects.
Test UI Customization
Test UI Customization
When using UI customization metadata (colors, fonts), test thoroughly on different devices and iOS versions to ensure compatibility.
Troubleshooting
Custom Fonts Not Appearing
- Verify font files are added to your Xcode project
- Check that fonts are listed in
Info.plistunderFonts provided by application - Ensure the font file names in metadata match exactly (including extension)
- Try building and running on a physical device (simulator may behave differently)
Metadata Not Appearing in Dashboard
- Confirm the verification was completed successfully
- Check that metadata keys don’t conflict with reserved system keys
- Verify the data types are supported (strings, numbers, booleans)
- Allow a few moments for data to sync to the dashboard
Language Not Changing
- Ensure the language code is one of the supported values
- Check for typos in the language code (case-sensitive)
- Verify
fixedLanguageis spelled correctly in the metadata dictionary
Next Steps
Delegates
Learn how to handle verification results with delegates
Authentication
Understand clientId and flowId parameters