tencent cloud

Tencent Cloud Super App as a Service

Release Notes and Announcements
Announcement: Tencent Cloud Mini Program Platform Renamed to Tencent Cloud Super App as a Service on January 2, 2025
Console Updates
Android SDK Updates
iOS SDK Updates
Flutter SDK Updates
IDE Updates
Base Library Updates
Product Introduction
Overview
Strengths
Use Cases
Purchase Guide
Billing Overview
Pay-As-You-Go Billing
Renewal Guide
Service Suspension Instructions
Getting Started
Plan Management
Overview
Console Account Management
Storage Configuration
Acceleration Configuration
Branding Configurations
Platform Features
Console Login
Users and Permission System
Mini Program Management
Mini Game Management
Superapp Management
Commercialization
Platform Management
User Management
Team Management
Operations Management
Security Center
Code Integration Guide
Getting Demo and SDK
Android
iOS
Flutter
Superapp Server
GUID Generation Rules
Mini Program Development Guide
Mini Program Introduction and Development Environment
Mini Program Code Composition
Guide
Framework
Components
API
Server Backend
JS SDK
Base Library
IDE Operation Instructions
Mini Game Development Guide
Guide
API
Server Backend
Practice Tutorial
Mini Program Login Practical Tutorial
Mini Program Subscription Message Practical Tutorial
Payment Practical Tutorial
Ad Integration Practical Tutorial
Mini Game Subscription Message Practical Tutorial
API Documentation
History
Introduction
API Category
Making API Requests
Operation Management APIs
User Management APIs
Team Management APIs
Sensitive API-Related APIs
Role Management APIs
Platform Management APIs
Other Console APIs
Mini Program or Mini Game APIs
Management-Sensitive APIs
Global Domain Management APIs
Superapp APIs
Data Types
Agreements
Service Level Agreement
Data Processing and Security Agreement
SDK Privacy Policy Module
SDK Data Processing and Security Agreement Module

Opening a Mini Program

PDF
Focus Mode
Font Size
Last updated: 2025-12-19 22:53:54

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 background 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.
// Open the mini program using the mini program appid

// @param appID Mini program appid
// @param verType The version type of the mini program to open
// @param scene Scene value
// @param firstPage The first page of the mini program to open
// @param paramsStr The parameter used to open the mini program
// @param parentVC The view controller from which to present the scan view controller
// @param completion Error callback
- (void)startUpMiniAppWithAppID:(NSString *)appID
verType:(TMAVersionType)verType
scene:(TMAEntryScene)scene
firstPage:(NSString * _Nullable)firstPage
paramsStr:(NSString * _Nullable)paramsStr
parentVC:(UIViewController *)parentVC
completion:(void (^)(NSError * _Nullable))completion;
Supported parameters for options:
Name
Required
Type
Description
appid
True
NSString
The appid of the mini program to open.
verType
True
TMAVersionType
The type of the mini program to open.
scene
True
TMAEntryScene
The scene value for opening the mini program.
firstPage
False
NSString
The first page of the mini program to open.
paramsStr
False
NSString
The parameters to pass when opening.
parentVC
True
UIViewController
The view controller from which to present the scan view controller.
completion
True
block
Error callback.
Note:
After passing paramsStr to mini-program, the mini-program retrieves extendData from the callback function of App.onLaunch or wx.getLaunchOptionsSync.

Open a mini program by mini program appid

To open the released version of a mini program :
[[TMFMiniAppSDKManager sharedInstance] startUpMiniAppWithAppID:appId parentVC:self completion:^(NSError * _Nullable error) {
NSLog(@"open applet error:%@",error);
}];
Note:
The appid is the ID of the mini program, which can be obtained from the mini program developer or via the mini program search API.
To preview or open the development version of a mini program:
[[TMFMiniAppSDKManager sharedInstance] startUpMiniAppWithAppID:appId verType:verType scene:TMAEntrySceneAIOEntry firstPage:nil paramsStr:nil parentVC:self completion:^(NSError * _Nullable error) {
NSLog(@"open applet error:%@",error);
}];
Note:
The appVerType should match the version of the mini program. The value of the appVerType can be obtained from the TMFAppletSearchInfo object instance returned by the API (getRecentList).
The value of appVerType for the mini program preview should be TMAVersionPreview.
The value of appVerType for the development version of the mini program should be TMAVersionDevelop.

Scan the QR code to open a mini program

The mini program SDK provides a capability to open the mini program by scanning the QR code. You need to integrate the extension library TCMPPExtScanCode before scanning the QR code.
// Scan the QR code to open the mini program
// @param parentVC The view controller from which to present the scan view controller
// @param completion Error callback
- (void)startUpMiniAppWithQRCodeWithParentVC:(UIViewController *)parentVC
completion:(void (^)(NSError * _Nullable))completion;

Open a mini program through QR code

The mini program SDK provides an API to open mini programs based on QR code scanning. Before using the scanning capability provided by the mini program SDK, you need to integrate the scanning extension capability. For details about the integration, refer to the scanning capability documentation.
After integrating the scanning capability, you can start the QR code scanning and open the mini program as follows:
/// Open a mini program via the QR code
/// @param qrData QR code content
/// @param parentVC The view controller from which to present the scan view controller
/// @param completion Error callback
- (void)startUpMiniAppWithQrData:(NSString *)qrData
parentVC:(UIViewController *)parentVC
completion:(void (^)(NSError * _Nullable error))completion;

Open the released version of a mini program through QR code

Starting from version 2.0.9, the QR code for the released version of a mini program can be generated and modified in the console. Once the superapp scheme is configured, you can open the mini program by scanning the QR code with the system camera.
Go to Superapp management - Mini program approval - Available in the console, click Download QR code in the Operation column, and the following pop-up appears:



The default scheme is tcmpp plus last few characters of the appid, which can be found through Superapp management - Superapp list.



The client needs to return the scheme protocol name via the getAppScheme delegate method. Example code:

- (NSString *)getAppScheme{
return @"tcmpp";
}
In the main project's info.plist file, configure the same scheme under URL Types:



Implement the handleOpenUrl method in the openUrl method. See the example below:

- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options {
if ([[TMFMiniAppSDKManager sharedInstance] handleOpenUrl:url]){
return YES;
}
return YES;
}
Once completing the above steps, you can scan the QR code in the console with the system camera to open the released version of the mini program.

Open a mini program by specified startup options

Note:
Supported in version 2.2.10 and later.
The mini program can be started up by specified startup options.
// Start up the mini program by the startup options

// @param appID The appid of the mini program to start up
// @param options The options for starting the mini program
// @param parentVC The parent view controller
// @param completion The completion block
- (void)startUpMiniAppWithAppID:(NSString *)appID
options:(TMAStartUpOptions *)options
parentVC:(UIViewController *)parentVC
completion:(void (^)(NSError * _Nullable))completion;
TMAStartUpOptions List of supported options:
Name
Type
Default value
Description
verType
TMAVersionType
TMAVersionOnline
The type of the mini program to open.
scene
TMAEntryScene
TMAEntrySceneAIOEntry
The scene value for opening the mini program.
firstPage
NSString
nil
The first page of the mini program to open.
paramsStr
NSString
nil
The parameters to pass when opening.
forceUpdate
BOOL
NO
Whether to enforce checking for the latest version.
Note:
After passing paramsStr to mini-program, the mini-program retrieves extendData from the callback function of App.onLaunch or wx.getLaunchOptionsSync.


Help and Support

Was this page helpful?

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

Feedback