Overview
The MetaMap SDK provides several customization options through themetadata parameter in the showMetaMapFlow method. You can customize button colors, fonts, language, and more.
Metadata Parameter
All customization options are passed as key-value pairs in themetadata dictionary:
- Swift
- Objective-C
Color Customization
Button Color
Customize the main button background color using hex color format:- Swift
- Objective-C
#FFFFFF)
Format: Hex color code (e.g., #FF5733, #00A86B)
Button Text Color
Customize the button title color using hex color format:- Swift
- Objective-C
#000000)
Format: Hex color code (e.g., #FFFFFF, #333333)
Example: Complete Color Customization
- Swift
- Objective-C
Language Customization
Fixed Language
Set a specific language for the SDK interface:- Swift
- Objective-C
"en")
Supported Languages:
| Code | Language |
|---|---|
en | English |
es | Spanish |
fr | French |
pt | Portuguese |
ru | Russian |
tr | Turkish |
de | German |
it | Italian |
pl | Polish |
th | Thai |
Example: Spanish Interface
- Swift
- Objective-C
Font Customization
Custom Fonts
You can customize both regular and bold fonts used throughout the SDK interface:- Swift
- Objective-C
Adding Custom Fonts to Your Project
- Add the
.ttfor.otffont files to your Xcode project - Ensure the fonts are included in your app target
- Add the font names to your
Info.plist:
Example: Custom Font Implementation
- Swift
- Objective-C
Additional Metadata Options
Identity ID (Re-verification)
Pass an existing identity ID to update or re-verify a user:- Swift
- Objective-C
Encryption Configuration ID
Enable data encryption by providing an encryption configuration ID:- Swift
- Objective-C
Custom Key-Value Pairs
You can also pass custom metadata that will be associated with the verification:- Swift
- Objective-C
Complete Customization Example
Here’s a comprehensive example combining multiple customization options:- Swift
- Objective-C
Metadata Parameters Reference
| Parameter | Type | Description | Default |
|---|---|---|---|
buttonColor | String | Button background color (hex) | #FFFFFF |
buttonTextColor | String | Button text color (hex) | #000000 |
fixedLanguage | String | SDK interface language | en |
regularFont | String | Regular font filename | System font |
boldFont | String | Bold font filename | System font |
identityId | String | Existing identity ID for re-verification | - |
encryptionConfigurationId | String | Encryption configuration ID | - |
Best Practices
- Color Contrast: Ensure sufficient contrast between button color and text color for accessibility
- Font Files: Always test custom fonts on device to ensure they load correctly
- Language Selection: Choose the appropriate language based on user preferences or device locale
- Metadata Size: Keep custom metadata reasonable in size and avoid sensitive information
- Hex Colors: Always use the
#prefix for hex color codes
Next Steps
- See UIKit Integration for Swift implementation
- See SwiftUI Integration for SwiftUI implementation
- See Objective-C Integration for Objective-C implementation