// 通过小程序id打开小程序// Open the mini program through the mini program id// @param appID 小程序ID - Mini program ID// @param verType 指定打开的小程序类型 - The version type of mini program to open// @param scene 场景值 - scene value// @param firstPage 打开页面 - open the page// @param paramsStr 带入参数 - brings in parameters// @param parentVC 从哪个vc呼起 - Which vc to call from// @param completion 错误回调 - error callback- (void)startUpMiniAppWithAppID:(NSString *)appIDverType:(TMAVersionType)verTypescene:(TMAEntryScene)scenefirstPage:(NSString * _Nullable)firstPageparamsStr:(NSString * _Nullable)paramsStrparentVC:(UIViewController *)parentVCcompletion:(void (^)(NSError * _Nullable))completion;
名称 | 是否必填 | 类型 | 作用 |
appID | YES | NSString | 打开指定小程序的小程序 id |
verType | YES | TMAVersionType | 打开小程序的类型 |
scene | YES | TMAEntryScene | 打开小程序使用的场景值 |
firstPage | NO | NSString | 打开页面 |
paramsStr | NO | NSString | 打开传递参数 |
parentVC | YES | UIViewController | 从哪个 VC 呼起 |
completion | YES | block | 错误回调 |
[[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);}];
// 通过扫码拉起小程序 - Quickly open the mini program through QRCode// @param parentVC 从哪个vc呼起 - Which vc to call from// @param completion 错误回调 - error callback- (void)startUpMiniAppWithQRCodeWithParentVC:(UIViewController *)parentVCcompletion:(void (^)(NSError * _Nullable))completion;
/// 通过二维码呼起小程序/// @param qrData 二维码内容/// @param parentVC 从哪个vc呼起/// @param completion 错误回调- (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;}
本页内容是否解决了您的问题?