1

While i am sending the packet of MessageEventManager i am geting error on return stenza

MessageEventManager.addNotificationsRequests(message, true, true, false, false);
            connection.sendPacket(message);

i have implement all the interface to received all the acknowledgement packet related to sent message

like

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) {

                }
            });

another interface

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);
                    }
                });
Flow
  • 23,572
  • 15
  • 99
  • 156
Alpan
  • 518
  • 1
  • 6
  • 20
  • "i am geting error on return stenza" Don't you think it would be relevant what the error actually is? Please show us the error – Flow Sep 21 '14 at 16:38
  • @Flow, got error lik DefaultPacket class casting exception while receving any acknowledgement. – Alpan Sep 22 '14 at 06:28

1 Answers1

2

@alpan, put this code while you are connecting to the xmpp server. this is enabling message event provider.

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

may this help you.

Rumit Patel
  • 8,830
  • 18
  • 51
  • 70