Skip to main content

Overview

The MetaMapMetadata class provides configuration options for customizing the MetaMap SDK’s behavior and appearance. Metadata is passed as a dictionary to the showMetaMapFlow method and supports various customization options including language, colors, fonts, and identification parameters.

Usage

Metadata is passed as an optional dictionary parameter when initializing the MetaMap flow:
MetaMap.shared.showMetaMapFlow(
    clientId: "YOUR_CLIENT_ID",
    flowId: "YOUR_FLOW_ID",
    metadata: [
        "fixedLanguage": "es",
        "buttonColor": "#FF5733",
        "buttonTextColor": "#FFFFFF",
        "identityId": "user_12345"
    ]
)

Properties

Language Configuration

fixedLanguage
String
default:"en"
Sets the SDK language. Supported languages include:
  • "en" - English (default)
  • "es" - Spanish
  • "fr" - French
  • "pt" - Portuguese
  • "ru" - Russian
  • "tr" - Turkish
  • "de" - German
  • "it" - Italian
  • "pl" - Polish
  • "th" - Thai
metadata: ["fixedLanguage": "es"]

Color Customization

buttonColor
String
default:"#FFFFFF"
Customizes the main button background color using hexadecimal color format.
metadata: ["buttonColor": "#FF5733"]
buttonTextColor
String
default:"#000000"
Customizes the main button text color using hexadecimal color format.
metadata: ["buttonTextColor": "#FFFFFF"]

Identity Configuration

identityId
String
Sets an identity ID parameter for re-verification purposes. Use this when you need to re-verify an existing user.
metadata: ["identityId": "user_12345"]

Security Configuration

encryptionConfigurationId
String
Sets the encryption configuration ID for encrypting sensitive data during transmission.
metadata: ["encryptionConfigurationId": "config_abc123"]

Font Customization

regularFont
String
Specifies a custom regular font file name. The font file must be included in your project.
metadata: ["regularFont": "CustomFont-Regular.ttf"]
The font file must be added to your project and properly configured in your app’s Info.plist under the UIAppFonts key.
boldFont
String
Specifies a custom bold font file name. The font file must be included in your project.
metadata: ["boldFont": "CustomFont-Bold.ttf"]
If custom fonts are not provided or cannot be found, the SDK will use default system fonts.

Complete Example

import MetaMapSDK

class ViewController: UIViewController {
    
    @objc private func metaMapButtonAction() {
        // Configure metadata with all available options
        let metadata: [String: Any] = [
            // Language
            "fixedLanguage": "es",
            
            // Colors
            "buttonColor": "#FF5733",
            "buttonTextColor": "#FFFFFF",
            
            // Identity
            "identityId": "user_12345",
            
            // Security
            "encryptionConfigurationId": "config_abc123",
            
            // Fonts
            "regularFont": "Roboto-Regular.ttf",
            "boldFont": "Roboto-Bold.ttf",
            
            // Custom data
            "customKey": "customValue",
            "userId": 12345
        ]
        
        MetaMap.shared.showMetaMapFlow(
            clientId: "YOUR_CLIENT_ID",
            flowId: "YOUR_FLOW_ID",
            metadata: metadata
        )
    }
}

Notes

  • All metadata parameters are optional
  • Custom metadata keys can be added for tracking purposes
  • Values can be of any JSON-compatible type (String, Int, Bool, Dictionary, Array)
  • Invalid color formats will fallback to default colors
  • Missing font files will fallback to system fonts

See Also

Build docs developers (and LLMs) love