tencent cloud

Feedback

Preloading offline mini programs

Last updated: 2024-07-03 18:03:03
    Offline mini programs are embedded within the host app. You need to download the mini program package from the console, import it into the host app project, and package its together with the app. During app usage, users can open an embedded mini program without needing to download it from the backend, allowing it to run even without an internet connection.

    Preloading process

    1. Download the required mini program from the console.
    
    2. Copy the downloaded mini program package to a custom assets directory. The offline mini program must strictly follow the naming convention and cannot be arbitrarily modified.
    Note:
    Naming convention for mini programs: {miniAppId}_{miniAppVersion}.apkg
    
    3. Specify the directory of the offline mini program in the SDK initialization configuration.
    [[TMFMiniAppSDKManager sharedInstance] setOffLineApkgsPath:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"Resource"]];

    Notes

    Offline mini programs must go through the mini program binding and releasing process. Only mini programs in the online state can download offline packages;
    Offline mini programs adhere to version management logic such as new version releases, version rollbacks, and removing. If the online version differs from the preloaded version, the client will fetch the online version;
    If a mini program is removed, the corresponding offline mini program preloaded in the app will also become unusable.
    
    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