Skip to content

Instantly share code, notes, and snippets.

@larryluoo
Created July 29, 2022 07:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save larryluoo/a3fc3dc6f383a3d078f585534e0b7732 to your computer and use it in GitHub Desktop.
Save larryluoo/a3fc3dc6f383a3d078f585534e0b7732 to your computer and use it in GitHub Desktop.
loginRoom
/** create a user */
ZegoUser user = new ZegoUser("user1");
ZegoRoomConfig roomConfig = new ZegoRoomConfig();
/** Token is generated by the user's own server. For an easier and convenient debugging, you can get a temporary token from the ZEGOCLOUD Admin Console */
roomConfig.token = "xxxx";
/** onRoomUserUpdate callback can be received only by passing in a ZegoRoomConfig whose "isUserStatusNotify" parameter value is "true".*/
roomConfig.isUserStatusNotify = true;
/** log in to a room */
engine.loginRoom("room1", user, roomConfig, (int error, JSONObject extendedData)->{
// (Optional callback) The result of logging in to the room. If you only pay attention to the login result, you can use this callback.
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment