powered by Jive Software

getChatManager() is not found in smack-core-4.0.2.jar

Hi friends

I am creating chat client using “smack-core-4.0.2.jar”. My code is below that i am trying to open chat manager. To do that i have followed the below code(piece of code). But i am getting the error “The method getChatManager() is undefined for the type XMPPConnection” in line ‘chatManager = connection.getChatManager();’

Totally i am using “smack_4_0_2” bundle libs.

config = new ConnectionConfiguration(server, port);

// config.setSASLAuthenticationEnabled(false);

config.setSecurityMode(SecurityMode.disabled);

XMPPConnection connection = new XMPPTCPConnection(config);

connection.connect();

System.out.println("Connected: " + connection.isConnected());

chatManager = connection.getChatManager();

messageListener = new MyMessageListener();

Please help me how to resolve that error.

Use ChatManager.getInstanceFor(connection)

2 Likes

Great it worked fine. Thank you so much