// 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 *)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 The view controller from which to present the scan view controller// @param completion Error callback- (void)startUpMiniAppWithQRCodeWithParentVC:(UIViewController *)parentVCcompletion:(void (^)(NSError * _Nullable))completion;
/// 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 *)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;}
// 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 *)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 | Whether to enforce checking for the latest version. |
Feedback