2014-09-20 66 views
1

雖然我發送MessageEventManager的包我就回stenza歌廳錯誤發送數據包時XMPP MessageEventManager錯誤?

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); 
        } 
       }); 
+0

「我在返回stenza時發生錯誤」您是否認爲這個錯誤實際上是相關的?請告訴我們錯誤 – Flow 2014-09-21 16:38:22

+0

@Flow,在收到任何確認消息時出現錯誤類似DefaultPacket類轉換異常。 – Alpan 2014-09-22 06:28:16

回答

3

@alpan,在連接到xmpp服務器時放置此代碼。這是啓用消息事件提供者。

ProviderManager pm=ProviderManager.getInstance(); 
pm.addExtensionProvider("x","jabber:x:event", new MessageEventProvider()); 

這可以幫助你。

+0

感謝兄弟真的工作... – Alpan 2014-09-22 09:25:02

相關問題