final param = {
"user_jid":"jid/resource",
"password": "password",
"host": "xmpphost",
"port": "5222",
"nativeLogFilePath": "filepath",
"requireSSLConnection": true,
"autoDeliveryReceipt": true,
"useStreamManagement": false,
"automaticReconnection": true,
};
XmppConnection xmppConnection = XmppConnection(param);
await xmppConnection.start(_onError);
await xmppConnection.login();
await xmppConnection.sendMessageWithType("xyz@domain", "Hi", "MSGID");
await xmppConnection.sendGroupMessageWithType("xyz@conference.domain", "Hi", "MSGID");
xmppConnection.logout();
xmppConnection.createMUC("groupName", true);
xmppConnection.joinMucGroups(List<String> allGroupsId)
await xmppConnection.sendCustomMessage("xyz@domain", "Hi", "MSGID","customTest");
await xmppConnection.sendCustomGroupMessage("xyz@conference.domain", "Hi", "MSGID","customText");
await flutterXmpp.sendDelieveryReceipt("xyz@domain", "Received-Message-Id", "Receipt-Id");
await flutterXmpp.addMembersInGroup("groupName", List<String> allMembersId);
await flutterXmpp.addAdminsInGroup("groupName", List<String> allMembersId);
await flutterXmpp.getMembers("groupName");
await flutterXmpp.getAdmins("groupName");
await flutterXmpp.getOwners("groupName");
await flutterXmpp.removeMember("groupName", List<String> allMembersId);
await flutterXmpp.removeAdmin("groupName", List<String> allMembersId);
var onlineCount = await flutterXmpp.getOnlineMemberCount("groupName");
var lastseen = await flutterXmpp.getLastSeen(jid);
await flutterXmpp.getMyRosters();
await flutterXmpp.createRoster(jid);
await flutterXmpp.joinMucGroup(groupId);
await flutterXmpp.requestMamMessages(userJid, requestSince, requestBefore, limit);
await flutterXmpp.changeTypingStatus(userJid, typingStatus);
await flutterXmpp.changePresenceType(presenceType, presenceMode);
XmppConnectionState connectionStatus = await flutterXmpp.getConnectionStatus();
void onXmppError(ErrorResponseEvent errorResponseEvent) {
// TODO : Handle the Error Event
}
void onSuccessEvent(SuccessResponseEvent successResponseEvent) {
// TODO : Handle the Success Event
}
void onChatMessage(MessageChat messageChat) {
// TODO : Handle the ChatMessage Event
}
void onGroupMessage(MessageChat messageChat) {
// TODO : Handle the GroupMessage Event
}
void onNormalMessage(MessageChat messageChat) {
// TODO : Handle the NormalMessage Event
}
void onPresenceChange(PresentModel presentModel) {
// TODO : Handle the PresenceChange Event
}
void onChatStateChange(ChatState chatState) {
// TODO : Handle the ChatState Event
}
void onConnectionEvents(ConnectionEvent connectionEvent) {
// TODO : Handle the ConnectionEvent Event
}
You can reach us via mail(hiren@xrstudio.in) the if you have questions or need support.