Mesibo Messaging Properties
In this reference section, we will describe various message properties you can set for outgoing messages and also properties you can view from any incoming or outgoing messages.
Message Content Properties
Following are the actual message content properties that you can set when sending a message. In addition, you can add a file or media using setContent()
function.
Property | Description | Default |
---|---|---|
data | Binary Data Message | null |
message | Text Message | null |
title | Message Title | null |
subtitle | Message Subtitle | null |
footer | Message Footer | null |
latitude | Location - Latitude | -720 (out of range) |
longitude | Location - Longitude | -720 (out of range) |
Messaging Endpoint Properties
Following are some of the protocol-level properties which describe the message ID, type, timestamp, remote peer, and group.
Property | Description | Default |
---|---|---|
mid | Message ID. 32-bit unique id when sending, it will be converted into global id 0xXXXXXXXX12345678 when delivering. Refer to the Message-ID section below for details | randomly assigned |
type | Message Type, you can assign any value | 0 |
peer | User address who sent the message | null |
groupid | Group ID if the message was sent to the group, zero otherwise | 0 |
profile | Profile of the user who sent the message | profile |
groupProfile | Profile of the group if the message was sent to the group, null otherwise | null |
ts | Message timestamp in milliseconds (epoch) | 0 |
date | date object with year, month, day, hours, mins, secs, and days elapsed | date |
Message Processing Properties
You can set the following optional properties to change the default message, media, and file-handling behavior. When you create a MesiboMessage
object, it is initialized with the default properties optimized for most usage. Hence, you generally don't need to set the properties described in this document.
Property | Description | Default |
---|---|---|
emojify | Emojify the text, replace a few commonly used emoticons with emoji | true |
matureContent | Mark it as matured content | true |
markForwarded | When forwarding messages(s), mark them as forwarded | true |
File Transfer Properties | ||
copyFiles | Copy files to the mesibo folder before sending. By default, mesibo does not copy to optimize the disk space and performance | false |
sendFileName | Send the name of the file. We provided this option for a financial institute customer wanting an option to protect file name | true |
sendThumbnail | Automatically generate a thumbnail from the file and send it with the message | true |
extractThumbnail | Mesibo API extracts a thumbnail from the incoming file if the thumbnail was not present. You can disable this option if you like the thumbnail to be not extracted or an alternate thumbnail/preview to be shown. This option was requested by one of the users in the dating space | true |
sendHqThumbnail | Send Higher thumbnail than normal - Mesibo API optimizes thumbnail size to optimize bandwidth, this OPTION can take utilize bandwidth from your mesibo account and not hence do not use it unless you have special needs | false |
horizontalThumbnail | Mesibo tries to maintain thumbnail orientation to be the same as images. This option overrides the default orientation | false |
verticalThumbnail | same as horizontalThumbnail but for vertical orientation | false |
imageProcessing | Resize media and generate thumbnail (if not set) as required | true |
thumbnailMaxSide | Maximum width or height of the thumbnail | auto |
thumbnailAspectRatio | Thumbnail aspect ratio for horizontal images. It is reversed for vertical images | auto |
passthroughSize | Mesibo compresses images for faster transfer and performance if the size is more than passthroughSize. You need to use file hosting to use this feature | auto |
secureDownload | Use auth token for authentication when downloading the file. Refer to the File Transfer section for more details | false |
asset | iOS Only - PHAsset Object | null |
localIdentifier | iOS Only - File Local Identifier | null |
URL and URL Preview Properties | ||
extractUrlFromMessage | Extract URL from the message | true |
urlPreview | Generate preview from the extracted or from the URL set using setContent() | true |
saveImageUrl | If the URL points to an image file, save it locally and extract the thumbnail (if applicable) | true |
saveVideoUrl | same as sameImageUrl described above but for video file | true |
saveAudioUrl | same as sameImageUrl described above but for audio file | true |
saveAllFileUrl | same as sameImageUrl described above but for all types of file | true |
urlTransferSize | save file only if the size is less than urlTransferSize | true |
Message-ID
One of the most important message properties is Message-ID. Message-ID is automatically assigned when you create a MesiboMessage
object. However, you can change it if requires. You should use a unique Message-ID for sending each message so that you can identify the message when the message status is received.
Message-ID is a 32-bit unique id. It will be converted into a 64-bit globally unique ID by the system. The ID which you have originally passed will be preserved in the lower 32-bit of the globally unique ID.
For example, if you send a message with id 0x12345678, it will be converted into global id 0xXXXXXXXX12345678 when delivering your message to the receiver. If you use zero Message-ID, the message will be delivered only if the recipient is online, it will be discarded otherwise.
You should use zero message-ID only for cases where storage is not required, for example, presence information like typing indicators, online status, etc.
You can set Message-ID by assignment.
message.mid = 0x12345;