tencent cloud

Feedback

Pre-Downloading Mini Program Package

Last updated: 2024-11-21 17:27:58
    When a mini program is launched, it synchronizes and updates its version, which may cause a waiting period. To reduce this waiting time and improve user experience, the following API is provided to pre-download mini program packages.

    Pre-download a single mini program package

    API description:
    /**
     * Pre-download main package of a mini program
     *
     * @param preDownloadInfo Pre-Downloading Info
     * @param callback Download callback
     */ public static void preDownloadPkg(PreDownloadInfo preDownloadInfo, IDownloadCallback callback)
    Sample code:
    PreDownloadInfo downloadInfo = new PreDownloadInfo("appId"); TmfMiniSDK.preDownloadPkg(downloadInfo, new IDownloadCallback() { @Override public void onFinish(DownloadInfo downloadInfo) { } @Override public void onError(DownloadInfo downloadInfo) { } });

    Pre-download multiple mini program main packages

    API description:
     /**
     * Pre-download main packages of mini programs
     * @param preDownloadInfos Pre-Downloading Info
     * @param callback Download callback
     */ public static void preDownloadPkg(List<PreDownloadInfo> preDownloadInfos, IDownloadCallback callback)
    Sample code:
    PreDownloadInfo downloadInfo = new PreDownloadInfo("appId"); PreDownloadInfo downloadInfo2 = new PreDownloadInfo("appId2"); ArrayList<PreDownloadInfo>infos = new ArrayList<>(); infos.add(downloadInfo); infos.add(downloadInfo2); TmfMiniSDK.preDownloadPkg(infos, new IDownloadCallback() { @Override public void onFinish(DownloadInfo downloadInfo) { } @Override public void onError(DownloadInfo downloadInfo) { } });
    
    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