Supported versions: 3.8 and newer with further requirements in respective sections below.

When a consumer starts a new conversation, or a new customer visits the site, brands can send the first message with a list of quick replies of common intents.

You can configure the Welcome message as a simple text message with or without quick replies, for example:

Welcome to our support! What can we help you with today?

[Questions about existing account] [open a new account] [tech support]

A consumer’s quick reply selection or answer gets inserted as their first message in the conversation, which opens the conversation in the Conversational Cloud agent workspace.

To use this feature with the Control History API, refer to the following page

Code Example of Basic Welcome Message Creation

class LPWelcomeMessage: NSObject {
    var message: String?
    var frequency: MessageFrequency 
    
}
enum MessageFrequency: Int {
        case FirstTimeConversation
        case everyConversation
    }

class LPWelcomeMessageOption: NSObject {
    let value: String                     // Text item for the screen reader to read to the user.
    let displayName: String               // Text which shows to the consumer on the quick reply
    let quickReplyStyle: QuickReplyStyle? // Individual style available from 6.18.0 with more details further below.
//Welcome message
var messageTitle = "Hello Mr.Smith, how may we help you?\n"
messageTitle.append("To know more about our terms and conditions visit:\n")
messageTitle.append("https://www.mywebsite.com") // this ability is only available on SDK 6.2.0 and Above

let welcomeMessageParam = LPWelcomeMessage(message: messageTitle, frequency: .everyConversation)

//adding options
let options = [
    LPWelcomeMessageOption(value: "My latest bill statement", displayName: "1️⃣ Bill"),
    LPWelcomeMessageOption(value: "A recent order placed", displayName: "2️⃣ Order"),
    LPWelcomeMessageOption(value: "Technical support", displayName: "3️⃣ Support"),
    LPWelcomeMessageOption(value: "Account information", displayName: "4️⃣ Account")
]

do {
    try welcomeMessageParam.set(options: options)
} catch {
    print(error.localizedDescription)
}

//ConversationViewParams
let conversationViewParams = LPConversationViewParams(conversationQuery: conversationQuery,
                                                     containerViewController: nil,
                                                     isViewOnly: false,
                                                     conversationHistoryControlParam: conversationHistoryControlParam,
                                                     welcomeMessage: welcomeMessageParam)
//show conversation
LPMessaging.instance.showConversation(conversationViewParams, authenticationParams: authenticationParams)

Support for rendering links automatically is available on SDK 6.2.0 and above.

Welcome Message Options

Welcome message quick reply options can be added to a welcome message object. You can see an example in the above code snippet. There are a few functions you can apply to the welcome message object to configure the options to it.

Welcome Message Option Setter

The set options function is used to set the welcome message options to the welcome message object.

func set(options: [LPWelcomeMessageOption]) throws {}
Parameter Description Required Defaults
options The quick reply option you want to set to the welcome message. Yes Maximum options is 24. The maximum display name characters is 25.

Welcome Message Rows Setter

The set NumberOfOptionsPerRow function allows configuration of how many quick reply options render per row of a welcome message. Optional to use as it has a default if unused.

func set(NumberOfOptionsPerRow: Int) {}
Parameter Description Required Defaults
NumberOfOptionsPerRow Number to appear per row. Yes Default value is 8. Must be greater than 0.

Styling Welcome Message Options

Supported Version: 6.18.0 and above.

Welcome Message Quickreply options have a style parameter that can individually configure how each option looks. There is no requirement to pass any or all of the values and they can be picked and chosen and items which are not passed or if the parameter is not passed at all will be default.

class QuickReplyStyle: NSObject {
     
     var bold: Bool?                   // Changes text from standard to bold
     var italic: Bool?                 // Changes text from standard to italic
     var color: UIColor?               // Changes text color
     var borderColor: UIColor?         // Changes option border color
     var borderRadius: CGFloat?        // Changes option border-radius
     var backgroundColor: UIColor?     // Changes option background color
     var size: QuickReplyStyleSize()?  // Changes option text size
}

enum QuickReplyStyleSize: String {
    case small = "small" 
    case medium = "medium"
    case large = "large"
}

Dynamic Welcome Message

Supported Version: 6.15.0 and above.

The welcome message can be updated more often by calling the setWelcomeMessage function alongside setting it when calling showConversation as outlined in the code examples above. Using this function allows the welcome message to be changed based on interactions mid-conversation or before the yet to be opened conversations instead of only between new conversations being opened and closed and the screen is opened and closed.

//Welcome message objects and items created the same as the non-dynamic example
var messageTitle = "Hello Mr.Smith, how may we help you?\n"
messageTitle.append("To know more about our terms and conditions visit:\n")
messageTitle.append("https://www.mywebsite.com") // this ability is only available on SDK 6.2.0 and Above

let welcomeMessageParam = LPWelcomeMessage(message: messageTitle, frequency: .everyConversation)

//Adding options
let options = [
    LPWelcomeMessageOption(value: "My latest bill statement", displayName: "1️⃣ Bill"),
    LPWelcomeMessageOption(value: "A recent order placed", displayName: "2️⃣ Order"),
    LPWelcomeMessageOption(value: "Technical support", displayName: "3️⃣ Support"),
    LPWelcomeMessageOption(value: "Account information", displayName: "4️⃣ Account")
]

do {
    try welcomeMessageParam.set(options: options)
} catch {
    print(error.localizedDescription)
}
//Adding a welcome message to the setter function which will immediately update the message which will be displayed the next time to the consumer.
LPMessaging.instance.setWelcomeMessage(welcomeMessageParam)

Welcome Message Configurations

  • Upon first load when the consumer has no history and a welcome message is not created in the host app the sdk will defaultly show a welcome message to not display to the consumer a blank screen. This welcome message pulls from the hiMessage string localization. You can use this to customize the default welcome message text if you do not wish to supply your own.
  • When using .open with the History Control Api the LPConfig enableWelcomeMessageForControlHistoryAPI must be set to true for a welcome message to appear. This does not apply to other history control options.

Limitations

  • You can configure up to 24 quick reply options, but you have a 25-character limit per quick reply option.

  • By default, eight quick replies are presented per row and quick replies styles inherit the Agent Bubble styling configuration. 6.18.0 and beyond styling can be added to the options in the code.

  • When the consumer ends the conversation, the window remains open, and the Welcome message appears again.

  • Quick reply messages do not get recorded in the conversation history.

  • The conversational metadata (ExternalId) does not get populated.

     "metadata": [
       {
         "type": "ExternalId",
         "id": "Yes-1234"
       }
     ]
    
  • Rendering links support only for URL, SMS, tel, facetime, and facetime-audio, and doesn't cover hyperlinks format.