1
下面是我的羣聊的Android代碼:包ID爲null從QuickBlox聊天室接收的消息
/* Sends messages */
public void sendChatMessage(String text)
{
Message message = muc.createMessage();
message.setBody(text);
message.setPacketID("ABC_1");
muc.sendMessage(message);
}
/* Listens for messages */
public void receiveMessage()
{
muc.addMessageListener(new PacketListener() {
public void processPacket(Packet packet)
{
final Message message = (Message) packet;
log.i("packed id: ", packet.getPacketID());
log.i("message id: ", message.getPacketID());
}
});
}
我在logcat中看到的輸出是:
包ID:空
消息ID:null
請問您爲什麼ID爲空?我在這裏錯過了什麼嗎?