Flexible Classroom provides a real-time interactive experience in the classroom out of the box. This document shows you how to integrate a custom user system and a custom course scheduling system with Flexible Classroom.
As shown in the figure above, if you need to integrate Flexible Classroom with your user system and course scheduling system, implement the following business logic:
- Deploy a Signaling token server in your backend services.
- Design a RESTful API for the following three purposes:
- Verify that the user logged into the app exists in the user system.
- If the user exists, obtain the user information and course scheduling information of the user.
- Get the Signaling token issued by the Signaling token generator for this user.
- Upon getting the user ID, classroom ID and Signaling token, the app calls the launch method of the Agora Classroom SDK. This starts the Flexible Classroom, and passes in the user ID, classroom ID, Signaling token and other parameters.
You need to pass either the user ID or the mapping of the user ID in your user system to Flexible Classroom as
userUuidis are globally unique, that is, each
userUuidi is only allowed to log in on one instance of one device at a time, and logging in again overwrites the previous device's login status.
userUuid in the same
roomUuiddata is retained, that is, if a user changes the device
userUuid in the same class, such as switching from browser login to mobile application login, the user's information in the class is not lost.
You need to pass the class ID (or the mapping of the class ID) in your own course scheduling system to the Flexible Classroom as
roomUuid is created when the first user enters and is completely destroyed 1 hour after the last user leaves.
Agora does not save your user information and classroom information. After the class is destroyed, if you reuse the previous
roomUuid again to enter the room, you get a new classroom instead of the previous one.
Note: Agora does not recommend that you reuse
roomUuid, as this makes it impossible to distinguish between two sessions. For example, use a new
roomUuid for each math class instead of reusing the same one for math classes of all grades.