ios QQ移动客服

2017-07-31  本文已影响28人  智能居家

#pragma mark -事件通知

#pragma mark客服

//在线客服

NSString*qqNumber=@"11111111";

if([[UIApplicationsharedApplication]canOpenURL:[NSURLURLWithString:@"mqq://"]]) {

UIWebView*webView = [[UIWebViewalloc]initWithFrame:CGRectZero];

NSURL* url=[NSURLURLWithString:[NSStringstringWithFormat:@"mqq://im/chat?chat_type=wpa&uin=%@&version=1&src_type=web",qqNumber]];

NSURLRequest*request = [NSURLRequestrequestWithURL:url];

[webViewloadRequest:request];

[self.viewaddSubview:webView];

}else{

UIAlertController*alertController = [UIAlertControlleralertControllerWithTitle:@"提示"message:@"对不起,您还没安装QQ"preferredStyle:UIAlertControllerStyleAlert];

UIAlertAction*cancelAction = [UIAlertActionactionWithTitle:@"取消"style:UIAlertActionStyleCancelhandler:^(UIAlertAction*action) {

return;

}];

[alertControlleraddAction:cancelAction];

[selfpresentViewController:alertControlleranimated:YEScompletion:nil];

}

}

上一篇下一篇

猜你喜欢

热点阅读