MBurger Engagement Platform
User GuideHeadless CMSEngagement Platform
  • 🍔MBurger Engagement Platform 🍔
  • 🍏 iOS Docs
    • Messages
      • Installation
      • Initialization
      • Push notifications
        • Rich Notifications
      • Stylize in app messages
      • Message Metrics
    • Audience
      • Installation
      • Initialization
      • Tracked data
      • Tags
      • Identify a user
      • Location
    • Automation
      • Installation
      • Initialization
      • Triggers
      • Send events
      • View Tracking
  • 📱Android Docs
    • Messages
      • Prerequisites for Push Notifications
      • Installation
      • Initialization
      • Stylization and parameters
      • Push notifications
      • Message Metrics
    • Audience
      • Installation
      • Initialization
      • Tracked data
      • Tags
      • Custom Id
      • Mobile User Id
      • Location Data
    • Automation
      • Installation
      • Initialization
      • Triggers
      • Add events
      • View Tracking
      • Stop/Pause tracking
  • 🔷Flutter Docs
    • Messages
      • Installation
      • Initialization
      • Stylize in app messages
      • Push notifications
        • Rich Notifications
      • Message Metrics
    • Audience
      • Installation
      • Initialization
      • Tracked data
      • Tags
      • Custom Id
      • Mobile User Id
      • Location Data
    • Automation
      • Installation
      • Initialization
      • Triggers
      • Send events
      • View Tracking
Powered by GitBook
On this page

Was this helpful?

  1. iOS Docs
  2. Messages

Stylize in app messages

If you want to specify fonts and colors of the messages displayed you can use the MBInAppMessageViewStyleDelegate protocol. All the functions of the protocol are optional, if a function is not implemented the framework will use a default value. The elements that can be stylized are the following:

  • backgroundStyle: can be a solid color or a translucent color

  • backgroundColor: the color of the background

  • titleColor: the text color for the title of the message

  • bodyColor: the text color for the body

  • closeButtonColor: the color of the close button

  • button1BackgroundColor: the background color of the first action button

  • button1TitleColor: the text color of the first action button

  • button2BackgroundColor: the background color of the second action button

  • button2TitleColor: the text color of the second action button

  • button2BorderColor: the border color of the second action button

  • titleFont: the font of the title

  • bodyFont: the font of the body

  • buttonsTextFont: the font of the buttons titles

Example:

func backgroundStyle(forMessage message: MBInAppMessage) -> MBInAppMessageViewBackgroundStyle {
    return .solid
}

func backgroundColor(forMessage message: MBInAppMessage) -> UIColor {
    return .green
}

func titleColor(forMessage message: MBInAppMessage) -> UIColor {
    return .blue
}

func bodyColor(forMessage message: MBInAppMessage) -> UIColor {
    return .darkText
}

func button1TitleColor(forMessage message: MBInAppMessage) -> UIColor {
    return .white
}

func button1BackgroundColor(forMessage message: MBInAppMessage) -> UIColor {
    return .cyan
}
PreviousRich NotificationsNextMessage Metrics

Last updated 4 years ago

Was this helpful?

🍏