// Open a mini app through the mini program ID// @param appID - Mini program ID// @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 first view controller to call// @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 | YES | NSString | ID of the mini program to open |
verType | YES | TMAVersionType | Type of the mini program to open |
scene | YES | TMAEntryScene | The scene value for opening the mini program |
firstPage | NO | NSString | The first page of the mini program to open |
paramsStr | NO | NSString | The parameter used to open the mini program |
parentVC | YES | UIViewController | The first view controller to call |
completion | YES | 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);}];
// Open the mini program through QRCode// @param parentVC - The first view controller to call// @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 first view controller to call/// @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;}
Was this page helpful?