XmppSessionConfiguration configuration = XmppSessionConfiguration.builder()
.debugger(VisualDebugger.class)
.defaultResponseTimeout(5000)
.build();
XmppSession xmppSession = new XmppSession("localhost", configuration, tcpConfiguration);
// Listen for incoming messages.
xmppSession.addMessageListener(new MessageListener() {
@Override
public void handle(MessageEvent e) {
if (e.isIncoming()) {
System.out.println(e.getMessage());
}
}
});
// Connect
xmppSession.connect();
// Login
xmppSession.login("111", "111", "geolocation");
// Send initial presence
xmppSession.send(new Presence());
// GeoLocationManager geoLocationManager = xmppSession.getExtensionManager(GeoLocationManager.class);
// geoLocationManager.publish(new GeoLocation(123, 321));
} catch (IOException | LoginException e) {