【2025年1月2日】关于腾讯云小程序平台更名为腾讯云超级应用服务的公告
控制台更新动态
Android SDK 更新动态
iOS SDK 更新动态
Flutter 更新动态
IDE 更新动态
基础库更新动态
// 通过小程序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;}
// 通过启动选项启动小程序// Start up the Mini App with the specified options// @param appID The ID of the Mini App to launch.// @param options The options for starting the Mini App.// @param parentVC The parent view controller.// @param completion The completion block.- (void)startUpMiniAppWithAppID:(NSString *)appIDoptions:(TMAStartUpOptions *)optionsparentVC:(UIViewController *)parentVCcompletion:(void (^)(NSError * _Nullable))completion;
名称 | 类型 | 默认值 | 作用 |
verType | TMAVersionType | TMAVersionOnline | 打开小程序的类型 |
scene | TMAEntryScene | TMAEntrySceneAIOEntry | 打开小程序使用的场景值 |
firstPage | NSString | nil | 打开页面 |
paramsStr | NSString | nil | 打开传递参数 |
forceUpdate | BOOL | NO | 是否强制检查使用最新版本 |
文档反馈