0
嗨如何將額外的字段添加到可寫入將附加內容傳遞到數據映射,例如我想能夠傳遞圖像的url從而允許圖像共享,如何去做,上午大多JS開發,所以沒有真正如何實現添加新功能的工作sinch服務器sinch即時消息可寫添加額外字段
public final class WritableMessage {
private static final int HEADER_MAX_SIZE = 1024;
private final String messageId;
private String textBody;
private string extraContent;// added here for passing img url
private List<String> recipientIds;
private Map<String, String> headers;
private int headerSize;
public WritableMessage(String recipientUserId, String textBody, extraContent) {
this();
this.addExtra(extraContent); // but the sinch doesnt allow overide
this.addRecipient(recipientUserId);
this.setTextBody(textBody);
}
應該擴展它的消息或者是有一個更好的方法這樣做 – user46772