zoukankan      html  css  js  c++  java
  • 【转】Android,iOS打开手机QQ与指定用户聊天界面

    在浏览器中可以通过JS代码打开QQ并弹出聊天界面,一般作为客服QQ使用。而在移动端腾讯貌似没有公布提供类似API,但是却可以使用schema模式来启动手机QQ。

    以下为具体代码:
    Android:


    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>
    看了上面的帖子,在apicloud中怎么实现呢???
    APICloud:

    Android <a href="mqqwpa://im/chat?chat_type=wpa&uin=123456">click here</a>

    iOS <a href="mqq://im/chat?chat_type=wpa&uin=123456&version=1&src_type=web">click here</a>

    如果是群的话
    <a href="mqqapi://card/show_pslcard?src_type=internal&version=1&uin=65895196&card_type=group&source=qrcode">和Qun聊天</a>

    from:http://community.apicloud.com/bbs/forum.php?mod=viewthread&tid=14524

  • 相关阅读:
    虚方法与非虚方法,native关键字
    Java多态
    Java对象初始化顺序
    继承、初始化
    递归,斐波那契,对象类型数组
    方法重载
    可变形参
    idea
    ss 如何解决margin-top使父元素margin失效
    js中call和apply的用法和区别
  • 原文地址:https://www.cnblogs.com/xuan52rock/p/7613960.html
Copyright © 2011-2022 走看看