Custom Media Message Content
Custom Media Message content base class.
Business party Inherits This class from Define Custom Media Message class type (need File Upload message, e.g. Custom Image, Custom File etc.). SDK internal Responsible for Register, Send (Including Upload) and Receive Decode, no need to access internal SDK any Type.
and CustomMessageContent difference:
Inherits from MediaMessageContent, automatically Contains localUri, remoteUri, name etc. Media Property
internal Send When go Media Upload channel/path, SDK automatically Handle File Upload
Subclass need:
Provides no-argument Constructor (SDK Via reflection Create instance)
Implements messageType, persistentFlag, encodeFields, decodeFields
Usage Example:
class CustomFileMessage : CustomMediaMessageContent() {
var fileType: String = ""
var fileSize: Long = 0L
override fun messageType(): String = "app:customfile"
override fun persistentFlag(): Int = MessageFlag.COUNT
override fun encodeFields(): Map<String, Any?> = mapOf(
"fileType" to fileType,
"fileSize" to fileSize
)
override fun decodeFields(fields: Map<String, Any?>) {
fileType = fields["fileType"] as? String ?: ""
fileSize = (fields["fileSize"] as? Number)?.toLong() ?: 0L
}
}
NCEngine.registerCustomMessages(listOf(CustomFileMessage::class.java))
NCEngine.registerCustomMessages(listOf(CustomFileMessage::class.java))Message type identifier.
Inherited properties
Functions
Receive message When Call. Note: localUri and remoteUri By SDK auto-restore,
Send message When Call. Note: localUri and remoteUri By SDK automatically Handle,
Not can by "RC:" prefix ("RC:" official reserved prefix).
See MessageFlag Constants:
Used for Message search Feature, Returns need Was/were indexed keyword.
Inherited functions
after reading i.e. burn-after-reading destroy When time (Unit: seconds), message Read after passing This When destroy after time
Media Content Local Path
@ mention Info
Media Content Upload Server after Remote URL
Whether after reading i.e. burn message
Whether after reading i.e. burn message
after reading i.e. burn-after-reading destroy When time (Unit: seconds), message Read after passing This When destroy after time
Media Content Local Path
@ mention Info
Media Content Upload Server after Remote URL