Metadata is an optional dictionary parameter that allows you to customize the SDK’s behavior, appearance, and pass additional data during the verification flow.
Overview
Metadata is passed to the showMetaMapFlow method:
MetaMap.shared.showMetaMapFlow(
clientId: "YOUR_CLIENT_ID",
flowId: "YOUR_FLOW_ID",
metadata: [
"fixedLanguage": "es",
"buttonColor": "#FF5733",
"identityId": "existing_identity_id"
]
)
Sets the SDK language. By default, the SDK uses English (“en”). Supported languages: “es”, “fr”, “pt”, “ru”, “tr”, “de”, “it”, “pl”, “th”.metadata: ["fixedLanguage": "es"]
Customizes the main button color using hex color format. Default is white.metadata: ["buttonColor": "#FF5733"]
Customizes the button text color using hex color format. Default is black.metadata: ["buttonTextColor": "#FFFFFF"]
Used for re-verification flows. Pass an existing identity ID to update or re-verify a user.metadata: ["identityId": "existing_identity_id_value"]
encryptionConfigurationId
Enables data encryption by passing an encryption configuration ID from your MetaMap dashboard.metadata: ["encryptionConfigurationId": "your_encryption_config_id"]
Sets a custom regular font. The font file must be included in your project.metadata: ["regularFont": "CustomFont-Regular.ttf"]
Sets a custom bold font. The font file must be included in your project.metadata: ["boldFont": "CustomFont-Bold.ttf"]
Complete Example
Swift
import MetaMapSDK
class ViewController: UIViewController {
@objc private func metaMapButtonAction() {
MetaMap.shared.showMetaMapFlow(
clientId: "YOUR_CLIENT_ID",
flowId: "YOUR_FLOW_ID",
metadata: [
"fixedLanguage": "es",
"buttonColor": "#007AFF",
"buttonTextColor": "#FFFFFF",
"identityId": "existing_user_identity",
"encryptionConfigurationId": "enc_config_123",
"regularFont": "Roboto-Regular.ttf",
"boldFont": "Roboto-Bold.ttf"
]
)
}
}
Objective-C
#import <MetaMapSDK/MetaMapSDK.h>
- (void)metaMapButtonAction:(UIButton *)sender {
[MetaMap.shared showMetaMapFlowWithClientId:@"YOUR_CLIENT_ID"
flowId:@"YOUR_FLOW_ID"
metadata:@{
@"fixedLanguage": @"es",
@"buttonColor": @"#007AFF",
@"buttonTextColor": @"#FFFFFF",
@"identityId": @"existing_user_identity",
@"encryptionConfigurationId": @"enc_config_123",
@"regularFont": @"Roboto-Regular.ttf",
@"boldFont": @"Roboto-Bold.ttf"
}];
}
Custom Fonts
To use custom fonts:
- Add your font files (.ttf or .otf) to your Xcode project
- Include the fonts in your Info.plist under “Fonts provided by application”
- Reference the font file names in the metadata
metadata: [
"regularFont": "YourFont-Regular.ttf",
"boldFont": "YourFont-Bold.ttf"
]
If the specified font files are not found in your project, the SDK will fall back to default fonts.
You can also pass custom key-value pairs for your own tracking or business logic:
metadata: [
"userId": "12345",
"campaignId": "summer_2024",
"referralCode": "FRIEND10",
"accountType": "premium"
]
These custom values will be associated with the verification and can be retrieved via the MetaMap API or dashboard.