在浏览器中能够经过JS代码打开QQ并弹出聊天界面,通常做为客服QQ使用。而在移动端腾讯貌似没有公布提供相似API,可是却能够使用schema模式来启动手机QQ。html
如下为具体代码:java
Android:web
- String url="mqqwpa://im/chat?chat_type=wpa&uin=123456";
- startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
iOS:
- UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectZero];
- NSURL *url = [NSURL URLWithString:@"mqq://im/chat?chat_type=wpa&uin=123456&version=1&src_type=web"];
- NSURLRequest *request = [NSURLRequest requestWithURL:url];
- webView.delegate = self;
- [webView loadRequest:request];
- [self.view addSubview:webView];
浏览器:
- <a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=123456&site=qq&menu=yes">click here</a>
一键加入qq群操做
http://qun.qq.com/join.html