2021-RN笔记

Android

报错

React Native on Android: Cannot run program "node": error=2, No such file or directory

解决办法

命令行打开

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];
    }

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值