Scenario 1: Initialization
Description
The initialization API can be called for SDK initialization after a third-party application starts. You only need to call this API once. You must call this API before calling other functional APIs.
Service Process
During SDK initialization, call the initWithConfig API and then check whether the API is successfully called based on the returned value.
- Call the API.
- Build HWMOpenSDKConfig model parameters.
- Call the initWithConfig API to initialize the configuration. The data in the preceding step is used as input parameters.
- Check the returned value.
YES: The initialization is successful. NO: The initialization fails.
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.
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