Overview
The MetaMapUIConfig class provides UI configuration options for customizing the visual appearance of the MetaMap SDK. While this class exists in the SDK framework, its properties are configured through the metadata dictionary passed to the showMetaMapFlow method.
As of SDK version 3.22.8, UI configuration is handled through the metadata dictionary rather than direct class instantiation. See the examples below for proper usage.
Class Definition
SWIFT_CLASS ( "_TtC10MetaMapSDK15MetaMapUIConfig" )
@interface MetaMapUIConfig : NSObject
- ( nonnull instancetype ) init SWIFT_UNAVAILABLE;
+ ( nonnull instancetype ) new SWIFT_UNAVAILABLE_MSG( "-init is unavailable" );
@end
The MetaMapUIConfig class cannot be directly instantiated. Use the metadata dictionary approach shown in the usage section.
Configuration Options
UI customization is achieved through the following metadata keys:
Color Configuration
Sets the background color of the main action button using hexadecimal color format. metadata : [ "buttonColor" : "#FF5733" ]
Sets the text color of the main action button using hexadecimal color format. metadata : [ "buttonTextColor" : "#FFFFFF" ]
Font Configuration
Specifies the filename of a custom regular weight font. The font file must be included in your app’s bundle. metadata : [ "regularFont" : "CustomFont-Regular.ttf" ]
Font files must be properly registered in your app’s Info.plist under the UIAppFonts key.
Specifies the filename of a custom bold weight font. The font file must be included in your app’s bundle. metadata : [ "boldFont" : "CustomFont-Bold.ttf" ]
Language Configuration
Sets the UI language. Supported values: "en", "es", "fr", "pt", "ru", "tr", "de", "it", "pl", "th". metadata : [ "fixedLanguage" : "es" ]
Usage Examples
Basic UI Customization
import MetaMapSDK
class ViewController : UIViewController {
@objc private func showCustomizedFlow () {
let uiConfig: [ String : String ] = [
"buttonColor" : "#007AFF" ,
"buttonTextColor" : "#FFFFFF" ,
"fixedLanguage" : "en"
]
MetaMap. shared . showMetaMapFlow (
clientId : "YOUR_CLIENT_ID" ,
flowId : "YOUR_FLOW_ID" ,
metadata : uiConfig
)
}
}
#import <MetaMapSDK/MetaMapSDK.h>
@implementation ViewController
- ( void ) showCustomizedFlow {
NSDictionary * uiConfig = @{
@"buttonColor" : @"#007AFF" ,
@"buttonTextColor" : @"#FFFFFF" ,
@"fixedLanguage" : @"en"
};
[MetaMap.shared showMetaMapFlowWithClientId: @"YOUR_CLIENT_ID"
flowId: @"YOUR_FLOW_ID"
metadata: uiConfig];
}
@end
Custom Fonts and Colors
import MetaMapSDK
class ViewController : UIViewController {
private func configureCustomBranding () {
let brandingConfig: [ String : String ] = [
// Brand colors
"buttonColor" : "#FF5733" ,
"buttonTextColor" : "#FFFFFF" ,
// Custom fonts (must be in your bundle)
"regularFont" : "Montserrat-Regular.ttf" ,
"boldFont" : "Montserrat-Bold.ttf" ,
// Language
"fixedLanguage" : "es"
]
MetaMap. shared . showMetaMapFlow (
clientId : "YOUR_CLIENT_ID" ,
flowId : "YOUR_FLOW_ID" ,
metadata : brandingConfig
)
}
}
#import <MetaMapSDK/MetaMapSDK.h>
@implementation ViewController
- ( void ) configureCustomBranding {
NSDictionary * brandingConfig = @{
// Brand colors
@"buttonColor" : @"#FF5733" ,
@"buttonTextColor" : @"#FFFFFF" ,
// Custom fonts (must be in your bundle)
@"regularFont" : @"Montserrat-Regular.ttf" ,
@"boldFont" : @"Montserrat-Bold.ttf" ,
// Language
@"fixedLanguage" : @"es"
};
[MetaMap.shared showMetaMapFlowWithClientId: @"YOUR_CLIENT_ID"
flowId: @"YOUR_FLOW_ID"
metadata: brandingConfig];
}
@end
Adding Custom Fonts to Your Project
To use custom fonts with the MetaMap SDK:
Add your font files (.ttf or .otf) to your Xcode project
Ensure the fonts are included in your app target
Add the font filenames to your Info.plist:
< key > UIAppFonts </ key >
< array >
< string > Montserrat-Regular.ttf </ string >
< string > Montserrat-Bold.ttf </ string >
</ array >
Reference the font files in your metadata configuration
Complete Configuration Example
import MetaMapSDK
class VerificationViewController : UIViewController {
private func showFullyCustomizedFlow () {
let config: [ String : Any ] = [
// UI Configuration
"buttonColor" : "#6200EE" ,
"buttonTextColor" : "#FFFFFF" ,
"regularFont" : "OpenSans-Regular.ttf" ,
"boldFont" : "OpenSans-Bold.ttf" ,
"fixedLanguage" : "en" ,
// Identity Configuration
"identityId" : "user_12345" ,
// Security
"encryptionConfigurationId" : "config_abc123" ,
// Custom tracking data
"source" : "mobile_app" ,
"version" : "2.1.0"
]
MetaMap. shared . showMetaMapFlow (
clientId : "YOUR_CLIENT_ID" ,
flowId : "YOUR_FLOW_ID" ,
metadata : config
)
}
}
#import <MetaMapSDK/MetaMapSDK.h>
@implementation VerificationViewController
- ( void ) showFullyCustomizedFlow {
NSDictionary * config = @{
// UI Configuration
@"buttonColor" : @"#6200EE" ,
@"buttonTextColor" : @"#FFFFFF" ,
@"regularFont" : @"OpenSans-Regular.ttf" ,
@"boldFont" : @"OpenSans-Bold.ttf" ,
@"fixedLanguage" : @"en" ,
// Identity Configuration
@"identityId" : @"user_12345" ,
// Security
@"encryptionConfigurationId" : @"config_abc123" ,
// Custom tracking data
@"source" : @"mobile_app" ,
@"version" : @"2.1.0"
};
[MetaMap.shared showMetaMapFlowWithClientId: @"YOUR_CLIENT_ID"
flowId: @"YOUR_FLOW_ID"
metadata: config];
}
@end
Best Practices
Color Selection Use high contrast color combinations for better accessibility. Ensure text is readable against button backgrounds.
Font Compatibility Test custom fonts across different screen sizes and iOS versions. Provide fallback options if custom fonts fail to load.
Language Support Set fixedLanguage based on user preferences or device locale to provide the best user experience.
Consistent Branding Match the MetaMap UI colors and fonts to your app’s design system for a seamless user experience.
Notes
Invalid hexadecimal color values will fallback to defaults
If custom fonts are not found, the SDK uses system fonts
All UI configuration keys are optional
Configuration is applied per verification flow session
See Also