Message Customization
1. Message type
public enum CustomMessageType: Int {
case snap = 101
}#define SnapMessageType 1012. Hook into chat options to send the message
import ChatSDK
@objc public class CustomChatOption: BChatOption {
@objc public override func icon() -> UIImage! {
return UIImage(named: "YourIcon.png")
}
@objc override public func title() -> String! {
return "Your Title"
}
@objc override public func execute(_ viewController: UIViewController!, threadEntityID: String!, handler: PChatOptionsHandler!) -> RXPromise! {
let promise = RXPromise()
//...
// Execute your code. When it's complete, call promise.resolve(withResult: "") or promise.reject(withReason: "")
// Add message send code from step 3. here
return promise
}
}3. Send the message
4. Render the message
Last updated