Scenario 2: Login
Description
You can log in to the Huawei Cloud Meeting server using your Huawei Cloud Meeting account or app ID. The API for creating a meeting can be called only when you have logged in. To use complete meeting functions, log in to Huawei Cloud Meeting.
If you have not logged in, you can only join created meetings.
Service Process
When using the SDK for login, call the Login API, and then implement the OnLoginResult function.
- Call the API.
- Assemble the HwmLoginInfo data structure.
- Select a proper login type.
- Assign a value to the corresponding variable based on the login type.
- Call the Login API to log in. The data in the preceding step is used as input parameters.
- Assemble the HwmLoginInfo data structure.
- Implement the callback function.
Implement the OnLoginResult function.
Sample Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
/** * Login */ int demoLoginDlg::Login() { int ret; // Set app ID login parameters. /** *. The data conversion performed by the third-party server is omitted here. The nonce and signature are obtained. */ strncpy_s(loginParam.appIdAuthInfo.thirdUserId, GetUserId.c_str(), HWM_MAX_USER_ID_LEN); strncpy_s(loginParam.appIdAuthInfo.userName, GetUserName.c_str(), HWM_MAX_USER_NAME_LEN); strncpy_s(loginParam.appIdAuthInfo.signature, GetSignature().c_str(), HWM_MAX_SIGNATURE_LEN); strncpy_s(loginParam.appIdAuthInfo.nonce, GetNonce().c_str(), HWM_APPID_NONCE_LEN ); strncpy_s(loginParam.appIdAuthInfo.email, GetEmail.c_str(), HWM_MAX_EMAIL_LEN); strncpy_s(loginParam.appIdAuthInfo.phoneNumber, GetPhoneNumber.c_str(), HWM_MAX_PHONE_NUM_LEN); loginParam.appIdAuthInfo.expireTime = 1598398920; // UTC time, in seconds loginParam.authType = hwmsdkagent::HWM_AUTH_TYPE_APPID; // Call the login API. ret = hwmsdkagent::Login(&loginParam); return ret; } |
1 2 3 4 5 6 7 8 9 10 11 |
/** * Login API callback */ void demoCallbackProc::OnLoginResult(hwmsdk::HwmErrCode ret, const char* msg) { CString codeStr; codeStr.Format(_T("%d"), ret); string msgStr = CTools::UTF82MultiByte(msg); CString tips = _T("OnLoginResult code:") + codeStr + _T(", msg:") + CString(msgStr.c_str()); AfxMessageBox(tips); } |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot