0

Hi how to add extra field to the writable for passing additional content to the data map , for example i want to able to pass url for image thus allow image sharing , how to go about , am mostly js dev , so not really how to implement add new features to work sinch server

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
  • 241
  • 1
  • 2
  • 13

1 Answers1

1

Use addHeader to add extra stuff to you message

public WritableMessage(String recipientUserId, String textBody, string imageUrl) {
    this();
    this.addHeader("imageUrl", imageUrl); 
    this.addRecipient(recipientUserId);
    this.setTextBody(textBody);
}
cjensen
  • 2,703
  • 1
  • 16
  • 15