当我发送 MessageEventManager 的数据包时,我在返回 stenza 时收到错误
MessageEventManager.addNotificationsRequests(message, true, true, false, false);
connection.sendPacket(message);
我已经实现了所有接口来接收与发送消息相关的所有确认包
喜欢
MessageEventManager eventManager=new MessageEventManager(connection);
eventManager.addMessageEventNotificationListener(new MessageEventNotificationListener() {
@Override
public void offlineNotification(String from, String packetID) {
}
@Override
public void displayedNotification(String from, String packetID) {
DriftUtilities.showLog("EventNotification displayedNotification==> "+from+packetID);
}
@Override
public void deliveredNotification(String from, String packetID) {
}
@Override
public void composingNotification(String from, String packetID) {
DriftUtilities.showLog("EventNotification composingNotification==> "+from+packetID);
}
@Override
public void cancelledNotification(String from, String packetID) {
}
});
另一个界面
eventManager.addMessageEventRequestListener(new MessageEventRequestListener() {
@Override
public void offlineNotificationRequested(String from
, String packetID,
MessageEventManager messageEventManager) {
DriftUtilities.showLog("EventRequest offlineNotificationRequested==> "+from+packetID);
}
@Override
public void displayedNotificationRequested(String from
, String packetID,
MessageEventManager messageEventManager) {
DriftUtilities.showLog("EventRequest displayedNotificationRequested==> "+from+packetID);
}
@Override
public void deliveredNotificationRequested(String from
, String packetID,
MessageEventManager messageEventManager) {
DriftUtilities.showLog("EventRequest deliveredNotificationRequested==> "+from+packetID);
messageEventManager.sendDeliveredNotification(from, packetID);
}
@Override
public void composingNotificationRequested(String from
, String packetID,
MessageEventManager messageEventManager) {
DriftUtilities.showLog("EventRequest composingNotificationRequested==> "+from+packetID);
}
});