Android
报错
解决办法
命令行打开
studio /project file
ios
添加调试按钮
//检查是否不支持设备
[HHSupportDeviceManager hh_checkIsSupportDeviceInView:self.view];
//登录后检查年龄需求,要求未登录直接进入登录页面
if ([HHLoginViewController isNeedCheckAge] && ![HHAccountManager share].isLogin) {
[self showLoadding:nil];
@weakify(self);
[HHOneKeyLoginCustomController isCouldLoginWith:^(BOOL isCouldLogin) {
[self hideLoadding];
HHLoginViewController *loginVC = [[HHLoginViewController alloc] initWithParameters:@{}];
if (isCouldLogin) {
[HHOneKeyLoginCustomController requestLoginWithShowController:self.navigationController delegateController:loginVC animated:NO complete:^(BOOL isSuccess, NSString *errorMsg, NSDictionary *errorInfo) {
@strongify(self);
[self pushViewController:loginVC isReplace:NO animation:NO];
}];
} else {
@strongify(self);
[self pushViewController:loginVC isReplace:NO animation:NO];
}
}];
}
+++++++++++++++++
UIButton *rnBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
rnBtn.frame = CGRectMake(150, 50, 100, 40);
[rnBtn setTitleColor:[UIColor redColor] forState:(UIControlStateNormal)];
[rnBtn setTitle:@"打开RN本地调试" forState:UIControlStateNormal];
[rnBtn addTarget:self action:@selector(openRNView) forControlEvents:(UIControlEventTouchUpInside)];
[self.view addSubview:rnBtn];
}
- (void)openRNView {
CUJSAppOpenMiniAppRequest *req = [[CUJSAppOpenMiniAppRequest alloc] init];
req.checkPermission = YES;
req.showProgress = NO;
req.automaticHideLoading = YES;
req.isShowLottieLoading = NO;
req.isReplace = NO;
// req.isOpenMiniV2 = YES;
req.type = CUJSOpenMiniAppTypeReactNative;
req.path = @"http://localhost:8081/index.bundle?platform=ios";
req.moduleName = @"ClassroomStudent";
req.orientation = UIInterfaceOrientationMaskLandscape;
req.classType = CUJSOpenMiniAppClassTypeMath;
HHReactNativeController *vc = [[HHReactNativeController alloc] init];
vc.request = req;
vc.supportedOrientations = req.orientation;
[self pushViewController:vc isReplace:req.isReplace animation:YES];
}
|