如何使用qiscus sdk添加消息有效负载

时间:2017-11-01 04:15:53

标签: android json chat

我开发了与android qiscus sdk聊天。我有关于在QiscusComment.generateCustomMessage()中实现的自定义有效负载消息的问题。

任何人都可以帮助我吗? 感谢..

1 个答案:

答案 0 :(得分:1)

String message = "Survey Qiscus";
    JSONObject payload = new JSONObject();
    try {
        payload.put("sticker_url", "https://res.cloudinary.com/qiscus/image/upload/fxwzBRPcdz/Bubble-Pup-Yup.gif");
        payload.put("profile_url", "http://res.cloudinary.com/diufvqwbr/image/upload/v1507608923/logo_gb4lzy.png");
        payload.put("title_survey", "Qiscus@ Selles Survey");
        payload.put("date", "2017-10-29");
        payload.put("link_url", "https://www.qiscus.com/");
    } catch (JSONException e) {
        e.printStackTrace();
    }
    QiscusComment comment = QiscusComment.generateCustomMessage(message, "survey", payload,
            qiscusChatRoom.getId(), qiscusChatRoom.getLastTopicId());

您可以发送评论 的 sendQiscusComment (评语);

您可以使用JsonArrays自定义消息有效内容。我希望它能帮助您开发应用程序。

祝你好运!!