// Open the mini program using the mini program appid.// @param appID Specifies the mini program appid.// @param verType Indicates the version type of the mini program to open.// @param scene Specifies the scene value used to open the mini program.// @param firstPage Specifies the first page to open.// @param paramsStr Contains the parameters to pass to the mini program.// @param parentVC Represents the parent view controller to call from.// @param completion Specifies the callback block to be executed upon completion or failure.- (void)startUpMiniAppWithAppID:(NSString *)appIDverType:(TMAVersionType)verTypescene:(TMAEntryScene)scenefirstPage:(NSString * _Nullable)firstPageparamsStr:(NSString * _Nullable)paramsStrparentVC:(UIViewController *)parentVCcompletion:(void (^)(NSError * _Nullable))completion;
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. |
[[TMFMiniAppSDKManager sharedInstance] startUpMiniAppWithAppID:appId parentVC:self completion:^(NSError * _Nullable error) {NSLog(@"open applet error:%@",error);}];
[[TMFMiniAppSDKManager sharedInstance] startUpMiniAppWithAppID:appId verType:verType scene:TMAEntrySceneAIOEntry firstPage:nil paramsStr:nil parentVC:self completion:^(NSError * _Nullable error) {NSLog(@"open applet error:%@",error);}];
// Scan the QR code to open the mini program.// @param parentVC Represents the parent view controller to call from.// @param completion Specifies the callback block to be executed upon completion or failure.- (void)startUpMiniAppWithQRCodeWithParentVC:(UIViewController *)parentVCcompletion:(void (^)(NSError * _Nullable))completion;
/// Open a mini program via the QR code./// @param qrData Specifies the QR code content./// @param parentVC Represents the parent view controller to call from./// @param completion Specifies the callback block to be executed upon completion or failure.- (void)startUpMiniAppWithQrData:(NSString *)qrDataparentVC:(UIViewController *)parentVCcompletion:(void (^)(NSError * _Nullable error))completion;
- (NSString *)getAppScheme{return @"tcmpp";}

- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options {if ([[TMFMiniAppSDKManager sharedInstance] handleOpenUrl:url]){return YES;}return YES;}
${scheme}://applet?appId=${appId}&path=${encodedPath}¶ms=${encodedParams}
Parameter | Type | Required | Description |
appId | String | Yes | Mini program appid. |
path | String | No | The entry path of the mini program (requires URL encoding). |
params | String | No | The parameters passed to the mini program (requires URL encoding). |
forceUpdate | Number | No | When set to 1, it forces an update of the mini program before opening. |


// Start up the mini program with the startup options.// @param appID Specifies the ID of the mini program.// @param options Specifies the options for starting the mini program.// @param parentVC Represents the parent view controller to call from.// @param completion Specifies the callback block to be executed upon completion or failure.- (void)startUpMiniAppWithAppID:(NSString *)appIDoptions:(TMAStartUpOptions *)optionsparentVC:(UIViewController *)parentVCcompletion:(void (^)(NSError * _Nullable))completion;
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 | Indicates whether to force an update to the latest version. |
피드백