Updated on 2024-07-30 GMT+08:00

Login Using an App ID

Description

The login API can be used for login using an app ID.

If you have not logged in, you can only join created meetings.

Service Process

If you need to log in using the SDK, call the login API and then implement the callback.

  1. Call the API.

    1. Obtain the login account, expiration time, random number, username, and encrypted signature from the server.
    2. Call the login API to log in. The data in the preceding step is used as input parameters.

  2. Implement the callback.

    Implement the callback.

Sample Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
/// App ID login API
- (void)login {
    HWMAppIDLoginParam *appidInfo = [[HWMAppIDLoginParam alloc] init];
    appidInfo.thirdUserId = getThirdUserId();
    appidInfo.expireTime = 1599618620;
    appidInfo.nonce      = getNonce();
    appidInfo.userName   = getUserName();
    appidInfo.signature  = getSignature();
    [[HWMSdk getOpenApi] login:appidInfo callback:^(NSError * _Nullable error, HWMLoginResult * _Nullable result) {
        if (error == nil) {
            NSLog(@"Login succeeded.");
        }else{
            NSLog(@"Login failed.");
        }
    }];
}