快速接入
登录
调用doHtLoginWithLoginConfigM 方法登录,根据回调结果处理OA及IM相关业务。
若使用推送服务,需要配置deviceToken字段。
/**
* 点击登录
*/
- (IBAction)goLogin:(UIButton *)sender {
HtLoginCofigModel *configM = HtLoginCofigModel.new;
configM.serverUrl = self.serverField.text;
configM.loginId = self.accountField.text;
configM.password = self.pwdField.text;
[[HtImClientManager shareInstance] doHtLoginWithLoginConfigM:configM callBlock:^(NSInteger type, id response) {
NSLog(@"登录===%@", response);
if (type == HtReqCodeSuccess) {// 成功后跳转页面
HFunctionsViewController *funcVC = [[HFunctionsViewController alloc] initWithNibName:@"HFunctionsViewController" bundle:[NSBundle bundleForClass:self.class]];
[self.navigationController pushViewController:funcVC animated:YES];
}
}];
}
退出登录
退出App是需调用 doHtLogout 方法退出登录。
/**
* 退出
*/
- (IBAction)goLogout:(UIButton *)sender {
[[HtImClientManager shareInstance] doHtLogout];
}