Skip to main content

Scheduler Message

The SchedulerMessage class is used to create an interactive scheduler message that can be sent via CometChat. It extends the Interactive Messages class from CometChat.

Properties

NameTypeDescription
receiverUidStringThe ID of the receiver
receiverTypeStringThe type of the receiver
titleStringThe title of the scheduler message
scheduleElementButtonElementThe schedule button of the meet message.
goalCompletionTextStringThe text visible after completion of goal
interactionsInteractionsGives the list of elements you have interacted with
allowSenderInteractionboolAllows the sender interaction. default is false
avatarUrlStringurl to set avatar visible in scheduler bubble
timezoneCodeStringthe message sender's timezone code according to which availability is set
bufferTimeintThe time added between events
durationintThe time for the event slots
availabilityMap<String, List<DateTimeRange>>The date time range for availability in different days
dateRangeStartintDate from which event can be scheduled
dateRangeEndintDate upto which event can be scheduled
icsFileUrlStringurl to access ics file which can tell the schedule of message sender

Class Usage

How to create an instance of the SchedulerMessage class:

SchedulerMessage( 
title: 'Meeting with Dr. Jacob',
avatarUrl: 'https://some- avatar =url',
receiverUid: 'cometchat-uid-2',
receiverType: 'user',
muid: DateTime.now().millisecondsSinceEpoch.toString(),
duration: 30,
interactionGoal: InteractionGoal(type: InteractionGoalType.anyAction,elementIds: ["1"]),
timezoneCode: "Asia/Kolkata",
bufferTime: 15,
availability: {
"monday":[
TimeRange(from: "1100", to: "1900")
],
"tuesday":[
TimeRange(from: "1100", to: "1900")
],
"wednesday":[
TimeRange(from: "1100", to: "1900")
],
"thursday":[
TimeRange(from: "0000", to: "2400")
],
"friday":[
TimeRange(from: "1100", to: "2400")
],
},
icsFileUrl: "https:some-ics-file.ics",
sender: User(uid:"Dr. Jacob Twarog",name: "Dr. Jacob Twarog"),
receiver: User(name: "Trienke",uid: "Trienke"),
dateRangeStart: "2024-03-09",
dateRangeEnd:"2024-06-09",
scheduleElement: ButtonElement(
buttonText: "Schedule",
action: APIAction(url: "url", method: "method"),
elementType: UIElementTypeConstants.button,
elementId: "1",
disableAfterInteracted: true,
)
)

Send Scheduler Message

CometChatUIKit.sendSchedulerMessage(schedulerMessage, onSuccess: (SchedulerMessage message){
// TODO("Not yet implemented")
}, onError: (exception){
// TODO("Not yet implemented")
});