XMPP MessageEventManager error while send packet?

485 views Asked by At

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);
                    }
                });
1

There are 1 answers

0
Rumit Patel On BEST ANSWER

@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.