This topic describes the users, permissions, and operations for Live Interactive Messages.
Logon and authorization
Android integration
Log on
ImLoginReq req = new ImLoginReq();
req.user.userId = userId;
// Pass through additional business information.
Map<String, Object> data = new HashMap<>();
data.put("level", "high");
req.user.userExtension = App.getGson().toJson(data).toString();
req.userAuth = new ImAuth(nonce, timestamp, role, app_token);
AliVCIMEngine.instance().login(req, new ImSdkCallback());The role parameter specifies one of the following two roles:
Administrator (value: admin)
The admin role can create or close groups. If this role is not needed, you can leave this parameter empty. An administrator can perform all operations that a non-administrator can.
Non-administrator (value: a value other than admin)
iOS integration
Login requires authentication information that you obtain from the server-side. This information includes the timestamp, nonce, and token values.
Web integration
Login requires authentication information. Before you log in, ensure that the prerequisites are met and that you have obtained the authentication information from the server-side. This information includes the timestamp, nonce, and token values.
try {
// Make sure that the asynchronous init operation is successful before you perform this operation.
await engine.login({
user: {
userId: 'abc', // The ID of the user logging on to the current app.
userExtension: '{}', // User extension information, such as profile picture and nickname, encapsulated as a JSON string.
},
userAuth: {
timestamp: 22123123, // The timestamp value returned by the server.
nonce: 'nonce', // The nonce value returned by the server.
role: 'admin', // The admin role. Set to empty if not needed.
token: 'xxx' // The token value returned by the server.
},
});
} catch (error) {
// 304: Already logged on. 400: Invalid parameter. 403: Authentication failed during logon.
console.log(`login Fail: code:${error.code}, message: ${error.msg}`);
}WeChat mini program integration
Login requires authentication information. Before you log in, ensure that the prerequisites are met and that you have obtained the authentication information from the server-side. This information includes the timestamp, nonce, and token values.
try {
// Make sure the asynchronous init operation is successful before you perform this operation.
await engine.login({
user: {
userId: 'abc', // The ID of the user who logs on to the current application.
userExtension: '{}', // User extension information, such as the profile picture and nickname, encapsulated as a JSON string.
},
userAuth: {
timestamp: 22123123, // The timestamp value returned by the server.
nonce: 'nonce', // The nonce value returned by the server.
role: 'admin', // The admin role. If this role is not needed, you can leave this empty.
token: 'xxx' // The token value returned by the server.
},
});
} catch (error) {
// 304: Already logged on. 400: Invalid parameters. 403: Authentication failed during logon.
console.log(`login Fail: code:${error.code}, message: ${error.msg}`);
}Group administrators and group creators
A group creator is the user who creates the group. The identity of the creator varies based on how the group is created:
Groups created using the client SDK: By default, the creator is the user who performs the creation operation.
Groups created using OpenAPI: The creator is specified by a parameter when you call the API.
A group administrator is specified when the group is created and can be changed later. Both group creators and administrators have the following permissions:
Modify group information
Delete the group
Mute, Mute All, and Unmute
For more information about operation permissions, see the description of group administrator features in the client SDK documentation.
Group creators and administrators are not subject to any muting rules. This ensures that their ability to send messages in the group is unrestricted.