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
| Name | Type | Description |
|---|---|---|
| receiverUid | String | The ID of the receiver |
| receiverType | String | The type of the receiver |
| title | String | The title of the scheduler message |
| scheduleElement | ButtonElement | The schedule button of the meet message. |
| goalCompletionText | String | The text visible after completion of goal |
| interactions | Interactions | Gives the list of elements you have interacted with |
| allowSenderInteraction | bool | Allows the sender interaction. default is false |
| avatarUrl | String | url to set avatar visible in scheduler bubble |
| timezoneCode | String | the message sender’s timezone code according to which availability is set |
| bufferTime | int | The time added between events |
| duration | int | The time for the event slots |
| availability | Map<String, List<DateTimeRange>> | The date time range for availability in different days |
| dateRangeStart | int | Date from which event can be scheduled |
| dateRangeEnd | int | Date upto which event can be scheduled |
| icsFileUrl | String | url to access ics file which can tell the schedule of message sender |
Class Usage
How to create an instance of theSchedulerMessage class:
- Dart
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
- Dart
CometChatUIKit.sendSchedulerMessage(schedulerMessage, onSuccess: (SchedulerMessage message){
// TODO("Not yet implemented")
}, onError: (exception){
// TODO("Not yet implemented")
});