tencent cloud

Tencent Cloud Super App as a Service

Returning to the Mini Program

PDF
Focus Mode
Font Size
Last updated: 2025-08-29 17:28:03
Mini programs and mini games usually run in their own separate tasks. Sometimes, pages from the superapp’s main task, like login or payment will open. You might not be able to go back to the mini program right away because the task has switched. In these cases, the superapp can use backToMiniApp to return directly to the mini program.
/**
* Returns to the specified mini program
* Common use case: When invoking a page within the superapp main task (such as payment) via a custom API, after you finish these actions,
* if there are other pages in the main task, the normal return will go back to those pages instead of the mini program page.
* You can call backToMiniApp proactively to force returning to the mini program page.
* @param appId The mini program to return to
* @param appVerType The version type of the mini program to return to
*/
public static void backToMiniApp(String appId, int verType)



Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback