CNLIVEViewController.m 1.64 KB
//
//  CNLIVEViewController.m
//  CNLiveBBASMModule
//
//  Created by 杨苓玉 on 10/21/2021.
//  Copyright (c) 2021 杨苓玉. All rights reserved.
//

#import "CNLIVEViewController.h"
#import "CNLiveBBASMModule/CNLiveBBASMModuleService.h"
#import <CNLiveBeeHive/CNLiveBeeHive.h>

@interface CNLIVEViewController ()<HomeServiceProtocol>

@end

@BeeHiveService(HomeServiceProtocol, CNLIVEViewController)
@implementation CNLIVEViewController
- (UIViewController *)getConnnectVC
{
    CNLIVEViewController *vc = [[CNLIVEViewController alloc] init];
    return vc;
}
- (void)viewDidLoad
{
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(0, 40+100, 100, 44)];
    [btn addTarget:self action:@selector(action) forControlEvents:UIControlEventTouchUpInside];
    [btn setTitle:@"百度小程序" forState:UIControlStateNormal];
    btn.backgroundColor = [UIColor grayColor];
    [self.view addSubview:btn];
    UIButton *btn1 = [[UIButton alloc] initWithFrame:CGRectMake(150, 40+100, 100, 44)];
    [btn1 addTarget:self action:@selector(logOut) forControlEvents:UIControlEventTouchUpInside];
    [btn1 setTitle:@"退出百度登录" forState:UIControlStateNormal];
    btn1.backgroundColor = [UIColor grayColor];
    [self.view addSubview:btn1];
}
-(void)action{

    NSString *spURL = @"cnlive://swan/4fecoAqgCIUtzIyA4FAPgoyrc4oUc25c";
    [CNLiveBBASMModuleService openBBASMModule:spURL];
}
- (void)logOut
{
    [CNLiveBBASMModuleService accountLogout];
}
- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end