create both your user and connect to a conversation in one step:
@Override
public void onCreate() {
super.onCreate();
// Servers configuration
final String WS_URL= "...";
final String XMPP_URL= "...";
final String apikey = "...";
final String userIdsha = "...";
final String uniqueIdsha = "...";
final String hardwareId = "...";
final String platform = "android";
final String deviceName = "...";
final String osVersion = "...";
(new UserAndChatCreation(this, APIKEY, u_uniqueIdsha, u_hardwareId,
u_platform, u_deviceName, u_osVersion, WS_URL, XMPP_URL,
IDSHA_BOT, production))
.get(new UserAndChatCreateResponse.OnUserAndChatCreateListener() {
@Override
public void onResponse(UserAndChatCreateResponse response) {
//You can now start your Chat Activity.
}
}, null);
}
Examples
Polling unread messages by conversation:
Conversation c = ...;
c.messages.getCountPendingReadMessages();
Sending an invisible message:
Text textContent = new Text();
textContent.text = "invisible message bla bla...";
IMbeeCore.sendMessageWithFlags(CONVERSATION_ID, IMMPFormat.TYPE_MESSAGE, textContent