多屏助手API
引入头文件
#import <QXCClassSDK/QXCPlayBackSDKHeader.h>
初始化SDK 并设置代理;更多代理API说明,请点击此处。
[QXCPlayBackSDKHeader getInstance].delegate = self;
唤起多屏助手
通过扫码老师端的二维码获得相应数据
{ "command": "authorize", "data": { "name": "千学云", "token": "6e9c58dbfdc4b9765bb3|1|1594000755|31|2|4UHFO3effedavUZ9O|0" } }
获取多屏
UIViewController
并展示-(void)showMultiScreenAssistant{ NSString *qrCodeResult = @"{\"command\": \"authorize\", \"data\": {\"name\": \"千学云\", \"token\": \"6e9c58dbfdc4b9765bb3|1|1594000755|31|2|4UHFO3effedavUZ9O|0\"}}"; NSDictionary *resultDic = [NSJSONSerialization JSONObjectWithData:[qrCodeResult dataUsingEncoding:NSUTF8StringEncoding] options:NSJSONReadingMutableContainers error:nil]; NSString *commandStr = [resultDic valueForKey:@"command"]; if([commandStr isEqualToString:@"authorize"]){ NSDictionary *dataDic = [resultDic valueForKey:@"data"]; KMSAEnterParams *params = [[KMSAEnterParams alloc] init]; params.pStr = [dataDic valueForKey:@"token"]; params.userName = [dataDic valueForKey:@"name"]; [self presentViewController:[QXCMultiScreenAssistantHeader getInstance].getMultiScreenAssistantVC animated:YES completion:nil]; [[QXCMultiScreenAssistantHeader getInstance] enterMultiScreenAssistant:params]; } }
退出多屏助手,用户点击多屏助手返回按钮时,需要实现代理
closeMultiScreen
方法,并调用清空接口-(void)closeMultiScreen{ [[QXCMultiScreenAssistantHeader getInstance].getMultiScreenAssistantVC dismissViewControllerAnimated:YES completion:nil]; [[QXCMultiScreenAssistantHeader getInstance] clearMultiScreenAssistant]; }