About the Token Generation Instructions
Token Generation
1、Information Association
The following information needs to be obtained:
• companyDomain: The enterprise domain (required).
• authKey: The enterprise key (required).
• roomId: The room ID (required).
• userId: The user ID (required).
• privilegeExpiredTs: A timestamp representing the number of seconds elapsed since January 1, 1970, at 00:00:00 UTC. For example, if you want the privilege to expire 10 minutes after the Token is generated, you should set privilegeExpiredTs to the current timestamp plus 600 (seconds). If the privilege should never expire, set this value to 0.
For the acquisition of the enterprise domain and key, please refer to the enterprise details information in the Enterprise Management Console.
2、AES Encryption
Concatenate companyDomain, authKey, roomId, userId, and privilegeExpiredTs to form tokenString, and then perform AES encryption on tokenString.
3、Objective-C Example
1 2 3 4 5 6 |
|
SDK Usage
The TKRoomSDK supports joining a room using either the authKey method or the Token method
1. Joining the Room Using the authKey Method
When calling the joinRoom interface to join a room, there is no need to include the token field in the roomparams parameter
2. Joining the Room Using the Token Method
When calling the joinRoomEx interface to join a room, you need to include the token field in the roomparams parameter