tencent cloud

Tencent Cloud Super App as a Service

Opening the Mini Program

Download
Focus Mode
Font Size
Last updated: 2026-01-29 00:28:08

Open a mini program

When opening the mini program, the system will check whether there is a locally cached one. If not, it will automatically download the mini program from the remote server and then open it. If a cached version is available, the local mini program will be opened first while the system checks in the backend for any new versions on the server.
Note:
If a new version is available, it will be downloaded, and the next time you open the mini program, the updated version will be used.
Start up the mini program with the given appid:
appId: Mini program appid
Options: Startup options for the mini program
Future<MiniAppStartResult?> startMiniAppWithId(String appId, MiniStartOptions? options)
Example:
_tcmppFlutterPlugin.startMiniAppWithId(appId!, null);
Startup options:
class MiniStartOptions {
/// The path to enter the mini program
String? entryPath;

/// Always update the mini program at startup
bool? isForceUpdate;

/// String parameters passed to the mini program at startup
String? params;
/// Whether the mini program startup result is required
bool needResult;
}
Start up the mini program via the given link:
Link: The URI to start up the mini program
Options: The startup options for the mini program
Future<MiniAppStartResult?> startMiniAppWithLink(String link, MiniStartOptions? options)
Start up the mini program using the given information:
AppInfo: Information about the mini program to start up
Options: The startup options for the mini program
Future<MiniAppStartResult?> startMiniAppWithAppInfo(AppInfo appInfo, MiniStartOptions? options)
Example:
_tcmppFlutterPlugin.startMiniAppWithAppInfo(appInfo, null);
Start up the mini program by scanning the QR code:
Future<MiniAppStartResult?> startMiniAppByScan()

Get the mini program startup result

To help developers troubleshoot issues, the mini program SDK provides the capability to get the mini program startup result. This can be configured via the needResult property in MiniStartOptions. When set to true, it indicates that the result is required, with the default value being false.
class MiniAppStartResult {
/// Startup result code
int code;
/// Startup result information
Map<dynamic, dynamic>? info;
}
For results on Android, see Android Error Codes. For results on iOS, see iOS Error Codes



Help and Support

Was this page helpful?

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

Feedback