/*** 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)
boolean running = TmfMiniSDK.isMiniAppRunning("wx1234567890abcdef", MiniApp.TYPE_ONLINE);
/*** 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)
Enumeration value | Description |
MiniApp | Mini program |
MiniGame | Mini game |
// 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);
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.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.Was this page helpful?
You can also Contact sales or Submit a Ticket for help.
Help us improve! Rate your documentation experience in 5 mins.
Feedback