public MessagePayload encode() {
MessagePayload payload = super.encode();
payload.searchableContent = content;
payload.mentionedType = mentionedType;
payload.mentionedTargets = mentionedTargets;
try {
JSONObject objWrite = new JSONObject();
objWrite.put("content",content);
objWrite.put("name",name);
objWrite.put("gender",gender);
objWrite.put("jobStatus",jobStatus);
objWrite.put("location",location);
objWrite.put("company",company);
objWrite.put("department",department);
objWrite.put("position",position);
payload.binaryContent = objWrite.toString().getBytes();
} catch (Exception e) {
e.printStackTrace();
}
return payload;
}
安卓端通过这种方式发送消息,需要服务端读取binaryConten的内容,服务端要如何获取? 有没有实例代码?