Port 1: Create a group
Step 1): Create a group
Interface format
Description: Required parameter, parameter is Object . For example, provide "{}" or "{success:}" callback function can be , if not provided, error! However, the callback function is useless, and the function inside the callback function is not executed at all. Execution results have a return value, return a random string , useless!
var ret = conn.createroompres ({success:function (data) {Console.log (data)}})
Print
RET is:
"Webim_63953695"
The following two kinds of calling interface JS code are correct, the parameters must be an object. :
Conn.createroompres ({})
Conn.createroompres ({success:function (data) {Console.log (data)}})
Returns the result asChat-ui.jsIn the Handlegroupchat (message), whereMessage ObjectThe format is as follows:
{"type": "Groupchat", "from": "05288893869199846298#appkey@conference. li726-26/+8615912341013_3398351031 ","To ": "+8615912341013_3398351031", "Msgbody": {"type": "Groupchat","Item": {"Jid": "[email Protected]/smack","affiliation": "Owner", "Role": "Moderator"}, "code": ["110", "100", "201"]}}
Description: In the item"Affiliation": "Owner", "Role": "Moderator", indicating that this is aBuild a groupThe Operation! Returned byGroup numberIs in the From field "05288893869199846298#appkey"
Step 2): When creating, join a group member
webim--Group Chat