// 初始化小程序的配置信息对象
DCUniMPConfiguration *configuration = [[DCUniMPConfiguration alloc] init];
configuration.path = pagePath;
configuration.extraData = params;
configuration.openMode = DCUniMPOpenModePush; // 使用push方式打开小程序
configuration.enableGestureClose = YES; // 开启侧滑手势关闭小程序
[DCUniMPSDKEngine openUniMP:k_UniAppId configuration:configuration completed:^(DCUniMPInstance * _Nullable uniMPInstance, NSError * _Nullable error) {
}];
// 预加载小程序
DCUniMPConfiguration *configuration = [[DCUniMPConfiguration alloc] init];
[DCUniMPSDKEngine preloadUniMP:k_UniAppId configuration:configuration completed:^(DCUniMPInstance * _Nullable uniMPInstance, NSError * _Nullable error) {
NSLog(@"预载小程序 %@", error == nil ? @"成功" : @"失败");
}];
1 个回复
DCloud_iOS_XHY
SDK里面有demo工程,可以参考一下,如果问题未解决请加官方开发群 892918401 群里反馈一下