tencent cloud

Tencent Cloud Super App as a Service

Get Running Mini Programs

Download
Focus Mode
Font Size
Last updated: 2026-08-25 17:25:37

Feature overview

Starting from version 2.4.3, the SDK provides APIs for querying the running status. Superapps can use these APIs to check whether a specific mini program is running, or get a list of currently running mini programs and mini games for scenarios such as multi-instance management and task switching.
Note:
Only supported when called in the main process.

API description

Check whether a specific mini program is running.

/**
* Checks whether a specific mini program is running.
*
* @param appId Specifies the mini program appid.
* @param appVerType Specifies the version type, which must be the same as the one used at startup (e.g., MiniApp.TYPE_ONLINE).
* @return Returns true if the mini program is running.
*/
public static boolean isMiniAppRunning(String appId, int appVerType)
Example:
boolean running = TmfMiniSDK.isMiniAppRunning("wx1234567890abcdef", MiniApp.TYPE_ONLINE);

Get a list of currently running mini programs and mini games.

/**
* Gets a list of currently running mini programs and mini games.
*
* @param engineType Specifies the engine type. If this parameter is set to null, all running mini programs and mini games are returned.
* @return Returns a list of running MiniApp objects. The value can be null.
*/
public static List<MiniApp> getRunningAppList(MiniEngineType engineType)

MiniEngineType

Enumeration value
Description
MiniApp
Mini program
MiniGame
Mini game
Example:
// Gets all running mini programs and mini games.
List<MiniApp> all = TmfMiniSDK.getRunningAppList(null);
// Gets only running mini games.
List<MiniApp> games = TmfMiniSDK.getRunningAppList(MiniEngineType.MiniGame);

Notes:

These APIs can only be called in the main process.
The list returned by getRunningAppList can be null. Ensure that you check for null values before using it.
The appVerType parameter in isMiniAppRunning must be the same as the one used at startup.
The returned MiniApp object is a snapshot of the running status at the time of the query. For scenarios requiring high real-time accuracy, refresh the status as needed.



Help and Support

Was this page helpful?

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

Feedback