Messaging
This module enables publication and receipt of In-app Messages and Push notifications. The usage of this module is optional.
This module has the following classes:
- IMI.ICMessaging
- IMI.ICMessagingReceiver
- IMI.ICMediaFile: Deprecated
- IMI.ICAttachment
- IMI.ICTopic
- IMI.ICThread
IMI.ICMessaging
The ICMessaging singleton class facilitates you to send and receive Live Chat / In-App Messaging messages and update the read status for Live Chat / In-App Messaging and Push.
Public Methods | |
---|---|
void | connect() |
void | disconnect() |
void | fetchTopics(filter, callback) |
ICConnectionStatus | getConnectionStatus() |
ICMessaging | getInstance() |
boolean | isConnected() |
void | publishMessage(message, callback) |
void | setMessageAsRead( transactionId, callback) |
void | setMessagesAsRead( transactionId, callback) |
void | setICMessagingReceiver( callback) |
void | subscribeTopic(topic, callback) |
void | unsubscribeTopic(topic, callback) |
void | createThread |
void | fetchThreads |
void | fetchMessages |
Boolean | getOutgoing |
void | setOutgoing |
void | fetchStreams |
connect
This method is used to establish a connection to receive Real-Time Messages from the Webex Connect platform.
When the connection is successful, the status events are notified through ICMessagingReceiver.onConnectionStatusChanged
.
It throws an
Exception
if a user is not registered with Webex Connect or if the Live Chat / In-App Messaging feature is not enabled in the policy.
Syntax: void connect()
Example:
var messaging = IMI.ICMessaging.getInstance();
try {
messaging.connect();
} catch (error) {
console.log(error)
}
disconnect
This method is used to disconnect the connection between the app and the Webex Connect platform. If there is no active connection, then this method fails silently.
When the disconnection is successful, the status events are notified through ICMessagingReceiver.onConnectionStatusChanged
.
The disconnect method throws an
Exception
if a user is not registered with Webex Connect or Live Chat / In-App Messaging feature is not enabled in the policy.
ββSyntax: void disconnect()
ββExample:
var messaging = IMI.ICMessaging.getInstance();
try {
messaging.disconnect();
} catch (error) {
console.log(error)
}
fetchTopics
This method is used to get a list of topics that are configured with the Webex Connect app. Use the filter parameter to control the type of topics that are returned.
Results are reported through a callback.
ββSyntax: void fetchTopics(filter, callback)
ββParameters:
Parameter | Type | Description |
---|---|---|
filter | ICAccessLevelFilter | Refer to ICAccessLevelFilter class. |
callback | JSObject | Specifies the callback object. |
Example:
var messaging = IMI.ICMessaging.getInstance();
var callback = {
onSuccess: function(ictopicslist) {
console.log("success");
//Write your logic to read topics and subscribe/unsubscribe/publish on those topics.
if (ictopicslist) {
for (var i = 0; i < ictopicslist.length; i++) {
var icTopic = ictopicslist[i];
console.log(icTopic.getName());
}
}
},
onFailure: function(errormsg) {
console.log("failed to get topics");
}
};
messaging.fetchTopics(imi.ICAccessLevelFilter.All, callback);
getConnectionStatus
This method is used to get the current connection status between the SDK and Webex Connect platform.
ββSyntax: ICConnectionStatus getConnectionStatus()
ββReturn Value:
Returns the current connection status between the SDK and the Webex Connect platform.
ββExample:
var messaging = IMI.ICMessaging.getInstance();
try {
var connectionStatus = messaging.getConnectionStatus();
if (connectionStatus == imi.ICConnectionStatus.Connected) {
//write your logic here
}
} catch (error) {
console.log(error)
}
getInstance
This method is used to get the ICMessaging
singleton instance. The instance is created internally on demand.
ββSyntax: ICMessaging getInstance()
ββReturn Value:
Returns the ICMessaging
singleton instance.
ββExample:
var messaging = imi.ICMessaging.getInstance();
isConnected
This method is used to verify whether the Live Chat / In-App Messaging connection is established between SDK and Webex Connect. This is a convenience method for getConnectionStatus() == ICConnectionStatus.Connected
.
ββSyntax: boolean isConnected()
ββReturn Value:
Returns _true _if the Live Chat / In-App Messaging connection is established between SDK and Webex Connect.
ββExample:
var messaging = IMI.ICMessaging.getInstance();
try {
var isConnected = messaging.isConnected();
if (isConnected) {
//write your logic
}
} catch (error) {
console.log(error)
}
publishMessage
This method is used to publish the passed ICMessage
instance through Live Chat / In-App Messaging connection.
The results of the operation are reported through a callback.
ββSyntax: void publishMessage(message, callback)
ββParameters:
Parameters | Type | Description |
---|---|---|
message | ICMessage | Refer to ICMessage class. |
callback | JSObject | Specifies the callback object. |
ββExample:
var callback = {
onSuccess: function() {
console.log("message sent");
},
onFailure: function(errormsg) {
console.log("failed to send message");
}
};
var messaging = imi.ICMessaging.getInstance();
var message = new imi.ICMessage();
message.setMessage("Test message");
var thread = new imi.ICThread();
thread.setId("threadid <which is created using createThread()/came in Message>");
thread.setTitle("cricket");
thread.setStreamName("sports");
message.setThread(thread);
messaging.publishMessage(message, callback);
setMessageAsRead
This method is used to update the status of the message identified by transactionId as Read.
The results of the operation are reported through a callback.
ββSyntax: void setMessageAsRead(transactionId, callback)
ββParameters:
Parameter | Type | Description |
---|---|---|
transactionId | String | Specifies a single transaction id. |
callback | JSObject | Specifies the callback. |
ββExample:
//To send single message read status back to <<prodname>>
var messageTransactionId = "<your message transaction id>";
var messaging = IMI.ICMessaging.getInstance();
var callback = {
onSuccess: function() {
console.log("success");
},
onFailure: function(errormsg) {
console.log("failed ");
}
};
messaging.setMessageAsRead(messageTransactionId, callback);
setMessagesAsRead
This method is used to update the status of the message identified by transactionIds as Read.
The results of the operation are reported through a callback.
ββSyntax: void setMessagesAsRead(transactionIds, callback)
ββParameters:
Parameter | Type | Description |
---|---|---|
transactionIds | String [] | Specifies an array of transaction ids. |
callback | JSObject | Specifies the callback object. |
ββExample:
//To send mutliple messages read status back to <<prodname>>
var msgTransIds = ["transid1", "transid2", "transid3"];
var messaging = IMI.ICMessaging.getInstance();
var callback = {
onSuccess: function() {
console.log("success");
},
onFailure: function(errormsg) {
console.log("failed ");
}
};
messaging.setMessagesAsRead(msgTransIds, callback);
setICMessagingReceiver
This method is used to set ICMessagingReceiver callback. It contains two methods. When a message is received, ICMessagingReceiver.onMessageReceived
method is called. When a connection status is changed ICMessagingReceiver.onConnectionStatusChanged
method is called.
The results of the operation are reported through a callback.
ββSyntax: void setICMessagingReceiver(callback)
ββParameters:
Parameter | Type | Description |
---|---|---|
callback | ICMessagingReceiver | Refer to ICMessagingReceiver. |
ββExample:
//To receive connect status changes and published messages
var icMsgRecrCallback = new IMI.ICMessagingReceiver();
icMsgRecrCallback.onConnectionStatusChanged = function(statuscode) {
console.log("read the statuscode, based on the status do the operations");
if (statuscode == IMI.ICConnectionStatus.Connected) {
//Connected
} else if (statuscode == IMI.ICConnectionStatus.Error) {
//Error while connecting
}else if (statuscode == IMI.ICConnectionStatus.Refused) {
//Connection lost
} else {
//unknow error
}
};
icMsgRecrCallback.onMessageReceived = function(icMessage) {
//icMessage is IMI.ICMessage object
if (icMessage.getType() === imi.ICMessageType.Message) {
//here direct message came from server(message sent from api)
} else if (icMessage.getType() === IMI.ICMessageType.ReadReceipt) {
//here read receipt came from another application for device syncing(read sent from another device)
} else if (icMessage.getType() === IMI.ICMessageType.Republish) {
//here repulished message came from another application for device syncing (message send from another device)
}
}
var messaging = IMI.ICMessaging.getInstance();
messaging.setICMessagingReceiver();
subscribeTopic
This method is used to subscribe to the topic that has Read access level, allowing the SDK to receive messages on that topic.
The results of the operation are reported through a callback.
Incoming messages are received through
ICMessagingReceiver.onMessageReceived
.
ββSyntax: void subscribeTopic(topic, callback)
ββParameters:
Parameter | Type | Description |
---|---|---|
topic | String | Specifies the topic name to subscribe. |
callback | JSObject | Specifies the callback. |
ββExample:
//To subscribe to a topic
try {
var messaging = IMI.ICMessaging.getInstance();
var callback = {
onSuccess: function() {
console.log("success");
},
onFailure: function(errormsg) {
console.log("failed ");
}
};
var topic = "<Topic Name>";
messaging.subscribeTopic(topic, callback);
} catch (error) {
console.log(error)
}
unsubscribeTopic
This method is used to unsubscribe to the topic that has Read access level, preventing the SDK to receive messages on that topic. The messages may still be received until the callback has reported success.
The results of the operation are reported through a callback.
ββSyntax: void unsubscribeTopic(topic, callback)
ββParameters:
Parameter | Type | Description |
---|---|---|
topic | String | Specifies the topic name to unsubscribe. |
callback | JSObject | Specifies the callback. callback = { onSuccess: function(){ }, onFailure: function(){ } }; |
ββExample:
//To unsubscribe to a topic
try {
var messaging = IMI.ICMessaging.getInstance();
var callback = {
onSuccess: function() {
console.log("success");
},
onFailure: function(errormsg) {
console.log("failed ");
}
};
var topic = "<Topic Name>";
messaging.unsubscribeTopic(topic, callback);
} catch (error) {
console.log(error)
}
createThread
This method is used to create a thread based on streamId
and threadTitle
and send the result in a callback.
ββSyntax: createThread(streamId, threadtitle, createThreadCallBack)
ββParameters:
Parameter | Type | Description |
---|---|---|
streamId | String | Identity of the stream. |
threadTitle | String | Title of the thread. |
callback | Invokes to report operation success or failure. |
var createThreadCallBack = {
onSuccess: function (thread)
{
console.log(thread);
},
onFailure: function ()
{
console.log("failed to create thread")
}
};
messaging.createThread(steamid, threadtitle, createThreadCallBack);
closeThread
Use this API to close an existing thread
Syntax: closeThread (icThreadObj, callback)
Parameters:
Thread | Instance of ICThread object |
---|---|
callback | JS object containing onSuccess and onFailure methods. |
var closeThreadCallBack = {
onSuccess: function (threadObj) {
debug('closeThreadCallBack onSuccess', threadObj);
},
onFailure: function (err) {
debug("closeThreadCallBack onFailure", err);
},
};
function closeThread() {
//thread = new IMI.ICThread();instance of ICThread object
thread.setReasonForStatusChange(reason);
var messaging = IMI.ICMessaging.getInstance();
messaging.closeThread(thread, closeThreadCallBack);
}
fetchThreads
This method is used to get a list of threads that are created and at least one message transaction completed. Results are reported through the callback.
ββSyntax: fetchThreads(offset, limit, callback)
ββParameters:
Parameter | Type | Description |
---|---|---|
offset | String (mandatory parameter) | Pass offset value to fetch threads from that offset value. Default value is 0. |
limit | Integrer (mandatory parameter) | Specifies the maximum number of items that can be returned in threads array. Default value is 100. |
callback | Callback | Invokes to report if operation is a success or failure. Success callback returns an additional value, a positive value indicating more threads on the server. unread_msg_count : Each thread object returns this based upon βserver_inbox_versionβ in policy.onFetchThreadsSuccess(threads, hasMoreThreads) |
var messaging = IMI.ICMessaging.getInstance();
messaging.fetchThreads(offset, limit, callback);
fetchMessages
This method is used to get a list of messages from the Connect platform. All results are reported through the callback.
ββSyntax: fetchMessages(threadId, beforeDate, limit, callback)
ββParameters:
Parameter | Type | Description |
---|---|---|
threadId | String | Specifies the ThreadId value. |
beforeDate | Date | Specifies the date since the messages must be returned. This value is optional; if nothing is passed then it is considered as current Date Time. |
limit | Integer | Specifies the maximum number of items that can be returned in messages array. Default value is 100 |
calback | Callback | Invokes to report if operation is a success or failure. totalCount: fetchMessagesCallback returns total number of messages for the userid/thread.fetchMessagesSuccess(messages: any[], totalCount) |
isOutgoing | Boolean | Indicates if the message is mobile originated if the value is true. |
var messaging = IMI.ICMessaging.getInstance();
var messagesCallBack = {
onSuccess: function (messages) {
},
onFailure: function () {
console.log("failed to get messages");
}
};
messaging.fetchMessages(threadId, beforeDate, limit, callback);
fetchUnreadThreadCount
This method is used to get the count of threads that have unread messages.
ββSyntax: fetchUnreadThreadCount(callback)
ββParameters:
Parameter | Type | Decsription |
---|---|---|
callback | Callback | Invokes to report if operation is a success or failure. Count: returns the unread thread count for user fetchUnreadThreadCountSuccess(count) |
var messaging = IMI.ICMessaging.getInstance();
messaging.fetchUnreadThreadCount(callback);
getSDKVersion
This method gets the SDK version being used.
ββSyntax: getSDKVesrion()
ββReturns: string version of SDK
this.sdkVersion = "v" + IMIconnectPlugin.getSDKVersion();
getOutgoing
This method is used to get the list of outgoing messages.
ββSyntax: getOutgoing()
setOutgoing
This method is used to set the outgoing flag as true to indicate that the message is mobile originated.
ββSyntax: setOutgoing(true)
fetchStreams
This method is used to get a list of streams. All results are reported through the callback.
ββSyntax: fetchStreams(callback)
ββParameters:
Parameter | Type | Description |
---|---|---|
callback | Callback | Invokes to report if operation is a success or failure. |
var messaging = IMI.ICMessaging.getInstance();
var streamsCallBack = {
onSuccess: function (streams) {
//render streams
},
onFailure: function (error) {
alert("failed to get streams:");
}
};
messaging.fetchStreams(streamsCallBack);
IMI.ICMessagingReceiver
This class allows the interception of incoming messages and Live Chat / In-App Messaging connection status changes. The default class provides standard message handling. You must invoke setICMessagingReceiver
to set ICMessagingReceiver
callback.
Public Methods | |
---|---|
void | onConnectionStatusChanged(status) |
void | onMessageReceived(message) |
onConnectionStatusChanged
This method is invoked whenever there is a change to the Live Chat / In-App Messaging connection status.
ββSyntax: void onConnectionStatusChanged(status)
ββParameters:
Parameter | Type | Description |
---|---|---|
status | ICConnectionStatus | Refer to ICConnectionStatus class. |
onMessageReceived
This method is invoked whenever a new Live Chat / In-App Messaging message is received.
ββSyntax: void onMessageReceived(message)
ββParameters:
Parameter | Type | Description |
---|---|---|
message | ICMessage | Refer to ICMessage class. |
getCategory
This method is used to get the category of the interactive message.
ββSyntax: String getCategory()
ββReturn Value:
Returns the category of the message.
getChannel
This method is used to get the channel on which the message was received.
ββSyntax: String getChannel()
ββReturn Value:
Returns the channel.
getCustomTags
This method is used to get the custom or developer specified data that was sent as part of the message payload.
ββSyntax: JSObject getCustomTags()
ββReturn Value:
Returns the custom tags sent along with the message payload.
getExtras
This method is used to get the supplementary data that was sent as part of the message payload. The format of this data is controlled by the Webex Connect platform.
ββSyntax: JSObject getExtras()
ββReturn Value:
Returns the supplementary data that was sent along with the message payload.
getMedia
This method is used to get the media files that are attached to the message.
ββSyntax: imi.ICMediaFile[] getMedia()
ββReturn Value:
Returns the media files that ware attached to the message.
getMessage
This method is used to get the content of the message that is displayed to the end-users.
ββSyntax: String getMessage()
ββReturn Value:
Returns the text message that is displayed to the end-users.
getReplyTo
This method is used to get the topic to which the reply should be sent. This method is not applicable to Push messaging.
ββSyntax: String getReplyTo()
ββReturn Value:
Returns the topic to which reply should be sent.
getSenderId
This method is used to get the senderId an arbitrary identifier that is set by the sender of the message. This method is not applicable to Push messaging.
ββSyntax: String getSenderId()
ββReturn Value:
Returns the senderid of the message.
getTopic
This method is used to get the topic on which the message was received. This method is not applicable to Push messaging.
ββSyntax: String getTopic()
ββReturn Value:
Returns the topic on which the message was received.
getTransactionId
This method is used to get the transaction id that uniquely identifies the message transaction within the Webex Connect platform.
ββSyntax: String getTransactionId()
ββReturn Value:
Returns the transaction id that identifies the message transaction.
getUserId
This method is used to get the user id from which the message is originated. This method is not applicable to Push messaging.
ββSyntax: String getUserId()
ββReturn Value:
Returns the user id from which the message is originated.
setCustomTags
This method is used to set the custom tags object to be sent with an outgoing Live Chat / In-App Messaging. This method is not applicable to Push messaging.
ββSyntax: void setCustomTags(tags)
ββParameters:
Parameter | Type | Description |
---|---|---|
tags | JSObject | Specifies the JSONObject. |
setMedia
This method is used to set the media file attachments to be sent with an outgoing Live Chat / In-App Messaging. This method is not applicable to Push messaging.
ββSyntax: void setMedia(files)
ββParameters:
Parameter | Type | Description |
---|---|---|
files | IMI.ICMediaFile | Refer to imi.ICMediaFile class |
setMessage
This method is used to set the content of the text message to be sent with an outgoing Live Chat / In-App Messaging. This method is not applicable to Push messaging.
ββSyntax: void setMessage(message)
ββParameters:
Parameter | Type | Description |
---|---|---|
message | String | Specifies the content of the text message. |
setSenderId
This method is used to set the senderid to be sent with an outgoing Live Chat / In-App Messaging. This is arbitrary information such as a simple tag. This method is not applicable to Push messaging.
ββSyntax: void setSenderId(senderId)
ββParameters:
Parameter | Type | Description |
---|---|---|
senderId | String | Specifies the sender id. |
setTopic
This method is used to set the topic on which the message should be published. This method is not applicable to Push messaging.
ββSyntax: String setTopic(topic)
ββParameters:
Parameter | Type | Description |
---|---|---|
topic | String | Specifies the topic. |
getAttachments
This method is used to get the attachment files that are attached to the message.
ββSyntax: ICAttachment[] getAttachments()
ββReturn Type: Returns the attachment files attached to the message.
getThread
This method is used to get the thread details specified in the message.
ββSyntax: ICThread getThread()
ββReturn Type: Returns the thread details that were specified in the message.
getSubmitted
This method is used to get the message submitted date to the Connect platform.
ββSyntax: Date getSubmittedAt()
ββReturn Type: Returns the message submitted date to the Connect platform.
getDelivered
This method is used to get the message delivered date to the device.
ββSyntax: Date getDeliveredAt()
ββReturn Type: Returns the message delivered date to the device.
getReadAt
This method is used to get the message read date at the device.
ββSyntax: Date getReadAt()
ββReturn Type: Returns the message read date at the device.
getType
This method is used to get the message type.
ββSyntax: ICMessageType getType()
ββReturn Type: Returns the message type.
setAttachments
This method is used to set the media file attachments to be sent with an outgoing Live Chat / In-App Messaging. This method is not applicable to Push messaging.
ββSyntax: void setAttachments(final ICAttachment[] attachments)
ββParameters:
Parameter | Type | Description |
---|---|---|
attachments | Refer to ICAttachment class. |
setThread
This method is used to set the thread details that need to be specified in the message.
ββSyntax: void setThread(final ICThread thread)
ββParameters:
Parameter | Type | Description |
---|---|---|
thread | Refer to ICThread class. |
IMI.ICMediaFile
This class is deprecated.
This class exposes data relating to media file attachments that are received through Live Chat / In-App Messaging and used to attach media files to outgoing messages.
Public Methods | |
---|---|
String | getContentType() |
long | getDuration() |
double | getLatitude() |
double | getLongitude() |
String | getPreview() |
long | getSize() |
String | getURL() |
void | setContentType(icContentType) |
void | setDuration(duration) |
void | setLatitude(latitude) |
void | setLongitude(longitude) |
void | setPreview(preview) |
void | setSize(size) |
void | setURL(url) |
getContentType
This method is used to get the content type such as image/jpeg.
ββSyntax: String getContentType()
ββReturn Value:
Returns the content type such as image or jpg.
getDuration
This method is used to get the duration of the applicable audio and video files.
ββSyntax: long getDuration()
ββReturn Value:
Returns the duration of the audio and video files.
getLatitude
This method is used to get the latitude of the location passed in a message.
ββSyntax: double getLatitude()
ββReturn Value:
Returns the latitude of the location.
getLongitude
This method is used to get the longitude of the location passed in a message.
ββSyntax: double getLongitude()
ββReturn Value:
Returns the longitude of the location.
getPreview
This method is used to get the preview thumbnail as a string.
ββSyntax: String getPreview()
ββReturn Value:
Returns the preview thumbnail as a string.
getSize
This method is used to get the file size in bytes.
ββSyntax: long getSize()
ββReturn Value:
Returns the file size in bytes.
getURL
This method is used to get the URL of the media file.
ββSyntax: String getURL()
Return Value: This method returns the URL.
setContentType
This method is used to set the content type as IMI.ICContentType. The method should be called when creating new ICAttachment object.
Syntax: void setContentType(icContentType)
Parameters:
Parameter | Type | Description |
---|---|---|
icContentType | IMI.ICContentType | Specifies the content type. |
setDuration
This method is used to set the duration of the audio and video files.
ββSyntax: void setDuration(duration)
ββParameters:
Parameter | Type | Description |
---|---|---|
duration | long | Specifies the duration in milliseconds. |
setLatitude
This method is used to set the latitude of the location passed in a message.
ββSyntax: void setLatitude(latitude)
ββParameters:
Parameter | Type | Description |
---|---|---|
latitude | double | Specifies the latitude of the location. |
setLongitude
This method is used to set the longitude of the location passed in a message.
ββSyntax: void setLongitude(longitude)
ββParameters:
Parameter | Type | Description |
---|---|---|
longitude | double | Specifies the longitude of the location. |
setPreview
This method is used to set the preview of the media file.
ββSyntax: void setPreview(preview)
ββParameters:
Parameter | Type | Description |
---|---|---|
preview | String | Specifies the preview of the media file. |
setSize
This method is used to set the size of the file in bytes.
ββSyntax: void setSize(size)
ββParameters:
Parameter | Type | Description |
---|---|---|
size | long | Specifies the size of the file in bytes. |
setURL
This method is used to set the URL of the media file.
ββSyntax: void setURL(url)
ββParameters:
Parameter | Type | Description |
---|---|---|
url | String | Specifies the URL for the media. |
IMI.ICAttachment
This class exposes data relating to media file attachments that are received through Live Chat / In-App Messaging and used to attach media files to outgoing messages.
Public Methods | |
---|---|
String | getContentType() |
long | getDuration() |
double | getLatitude() |
double | getLongitude() |
String | getPreview() |
long | getSize() |
String | getURL() |
void | setContentType(contentType) |
void | setDuration(duration) |
void | setLatitude(latitude) |
void | setLongitude(longitude) |
void | setPreview(preview) |
void | setSize(size) |
void | setURL(url) |
getContentType
This method is used to get the content type such as image/jpeg.
ββSyntax: String getContentType()
ββReturn Value:
Returns the content type such as image or jpg.
getDuration
This method is used to get the duration of the applicable audio and video files.
ββSyntax: long getDuration()
ββReturn Value:
Returns the duration of the audio and video files.
getLatitude
This method is used to get the latitude of the location passed in a message.
ββSyntax: double getLatitude()
ββReturn Value:
Returns the latitude of the location.
getLongitude
This method is used to get the longitude of the location passed in a message.
ββSyntax: double getLongitude()
ββReturn Value:
Returns the longitude of the location.
getPreview
This method is used to get the preview thumbnail as a string.
ββSyntax: String getPreview()
ββReturn Value:
Returns the preview thumbnail as a string.
getSize
This method is used to get the file size in bytes.
ββSyntax: long getSize()
ββReturn Value:
Returns the file size in bytes.
getURL
This method is used to get the URL of the media file.
ββSyntax: String getURL()
ββReturn Value:
This method returns the URL.
setContentType
This method is used to set the content type such as image/jpeg.
ββSyntax: void setContentType(contentType)
ββParameters:
Parameter | Type | Description |
---|---|---|
contentType | String | Specifies the content type. |
setDuration
This method is used to set the duration of the audio and video files.
ββSyntax: void setDuration(duration)
ββParameters:
Parameter | Type | Description |
---|---|---|
duration | long | Specifies the duration in milliseconds. |
setLatitude
This method is used to set the latitude of the location passed in a message.
ββSyntax: void setLatitude(latitude)
ββParameters:
Parameter | Type | Description |
---|---|---|
latitude | double | Specifies the latitude of the location. |
setLongitude
This method is used to set the longitude of the location passed in a message.
ββSyntax: void setLongitude(longitude)
ββParameters:
Parameter | Type | Description |
---|---|---|
longitude | double | Specifies the longitude of the location. |
setPreview
This method is used to set the preview of the media file.
ββSyntax: void setPreview(preview)
ββParameters:
Parameter | Type | Description |
---|---|---|
preview | String | Specifies the preview of the media file. |
setSize
This method is used to set the size of the file in bytes.
ββSyntax: void setSize(size)
ββParameters:
Parameter | Type | Description |
---|---|---|
size | long | Specifies the size of the file in bytes. |
setURL
This method is used to set the URL of the media file.
ββSyntax: void setURL(url)
ββParameters:
Parameter | Type | Description |
---|---|---|
url | String | Specifies the URL for the media. |
IMI.ICTopic
This class exposes Real Time Messaging topic data that is used to publish outgoing messages or subscribe to receive incoming messages.
Public Methods | |
---|---|
ICAccessLevel | getAccessLevel() |
String | getCreatedBy() |
Date | getCreatedDate() |
String | getName() |
Date | getUpdatedDate() |
Boolean | isSubscribed() |
getAccessLevel
This method is used to get the access level assigned to the topic.
ββSyntax: imi.ICAccessLevel getAccessLevel(level)
ββReturn Value:
Returns the access level assigned to the topic.
getCreatedBy
This method is used to get name who created the topic.
ββSyntax: String getCreatedBy()
ββReturn Value:
Returns the name who created the topic.
getCreatedDate
This method is used to get the date on which the topic is created.
ββSyntax: Date getCreatedDate()
ββReturn Value:
Returns the date on which the topic is created.
getName
This method is used to get the topic name.
ββSyntax: String getName()
ββReturn Value:
Returns the topic name.
getUpdatedDate
This method is used to get the date on which the topic was last updated.
ββSyntax: Date getUpdatedDate()
ββReturn Value:
Returns the date on which the topic was last updated.
isSubscribed
This method is used to verify whether the current user is subscribed to the topic.
ββSyntax: Boolean isSubscribed()
ββReturn Value:
Returns true if the current user is subscribed to the topic.
IMI.ICThread
This class exposes the thread data from the Live Chat / In-App Messaging channel in a generalized form. It is also used to send Live Chat / In-App Messaging from an app to the Webex Connect platform.
Public Methods | |
---|---|
String | getId |
String | getTitle |
boolean | isWritable |
String | getStreamName |
Date | getCreatedAt |
Date | getUpdatedAt |
getId
This method is used to get thread ID information.
ββSyntax: String getId()
ββReturn Value: Returns the thread ID information.
getTitle
This method is used to get the thread title.
ββSyntax: String getTitle()
ββReturn Value: Returns the thread title.
isWritable
This method is used to validate if a thread is writable or not. A thread is writable for Conversation thread, else (for announcement) thread it is not writable.
ββSyntax: boolean isWritable()
ββReturn Value: Returns whether the thread is writable or not.
getStreamName
This method is used to get the stream name to communicate to the Connect platform.
ββSyntax: String getStreamName()
ββReturn Value: Returns the stream name.
getCreatedAt
This method is used to get the thread created date on the Connect platform.
ββSyntax: Date getCreatedAt()
ββReturn Value: Returns the thread created date on the Connect platform.
getUpdatedAt
This method is used to get the thread updated date on the Connect platform.
ββSyntax: Date getUpdatedAt()
ββReturn Value: Returns the thread updated date on the Connect platform.
Updated 19 days ago