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

Initializing the SDK

initWithConfig

API Description

This API is used to start and initialize the SDK.

Precautions

  1. You must call this API before calling other APIs.
  2. The initialization method must be called in the main thread.
  3. The return value only indicates whether the API is successfully called.

Method Definition

1
+ (BOOL)initWithConfig:(HWMOpenSDKConfig *)config;

Parameter Description

Table 1 Parameter description

Parameter

Mandatory

Type

Description

config

Yes

HWMOpenSDKConfig

Initialization information set.

Table 2 HWMOpenSDKConfig description

Parameter

Mandatory

Type

Description

appId

Yes

NSString *

App ID. For details about how to request an app ID, see Requesting an App ID in Developer Guide.

siteType

No

HWMSiteType

Login site type. The default value is HWMSiteTypeChina.

hideExternalLabel

No

BOOL

Whether to display the external label in the participant list. By default, the external label is displayed.

hideAllowJoinConfMenu

No

BOOL

Whether to hide the menu of meeting joining options in the security settings. By default, the menu is not hidden.

logKeepDays

No

NSInteger

Log storage duration. Valid value range is 3–30. The default value is 0. 0 indicates that logs are not deleted by day.

Note: 1 and 2 will be converted to 3, and the values greater than 30 will be converted to 30.

appUrl

No

NSString *

Official download link.

isSupportMultiAppLogin

No

BOOL

Whether to support login to multiple applications on the same device.

For details about how to request an app ID, see Requesting an App ID in Developer Guide.

Table 3 Enumerated values of HWMSdkSiteType

Enumerated Value

Description

HWMSiteTypeChina

Chinese mainland.

HWMSiteTypeAP

Asia Pacific.

Return Values

Table 4 Return values

Type

Description

BOOL

If the initialization succeeds, YES is returned. If the initialization fails, NO is returned.

Sample Code

1
2
3
4
5
6
7
/// Initialization.
HWMOpenSDKConfig *config = [[HWMOpenSDKConfig alloc] init];
config.appId = getAppId();// Enter the applied app ID.
BOOL result = [HWMSdk initWithConfig:config];
if (result) {
    NSLog(@"Initialization succeeded.");
}
  • The sample code in the typical scenario and API reference is pseudo code and cannot be directly used.