tencent cloud

Feedback

SDK Initialization

Last updated: 2024-03-08 14:24:53

    Obtaining Configuration Files

    Developers obtain the configuration file for the corresponding App from the open platform. This configuration file is a JSON file that contains all the information for the App to use the Mini Program platform. The configuration file is incorporated into the project and set as a resource in the package content. For specific operations, see Getting Configuration Files.

    Configuration Information Settings

    Initialize the TMFAppletConfig object according to the configuration file, and use TMFAppletConfig to initialize the TCMPP applet engine.
    SDK can support direct engine initialization, prepare network links in advance, update basic library information and configuration information, accelerate mini program loading, and can also support initialization when needed.
    Reference Code:
    // Setting up the Environment
    NSString *filePath = [[NSBundle mainBundle] pathForResource:@"tcmpp-ios-configurations" ofType:@"json"];
    if(filePath) {
    TMAServerConfig *config = [[TMAServerConfig alloc] initWithFile:filePath];
    [[TMFMiniAppSDKManager sharedInstance] setConfiguration:config];
    }

    Additional Initialization Actions

    Users can set up the open interface implementation instance as needed. If there is a need to integrate extension modules, initialize the extension API preparation.
    // Implementing the Mini Program Engine Proxy Class
    [TMFMiniAppSDKManager sharedInstance].miniAppSdkDelegate = [MIniAppDemoSDKDelegateImpl sharedInstance];
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support