移动端唤起QQ聊天 (ios android 包含微信、qq内置浏览器)

时间:2024-02-18 14:21:18
var u = navigator.userAgent;

            var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
            if(isiOS){
                if(u.toLowerCase().match(/MicroMessenger/i) == "micromessenger"){
                    window.open(\'http://wpa.qq.com/msgrd?v=3&uin=qq号码&site=qq&menu=yes\');
                }else{
                    window.open(\'mqqwpa://im/chat?chat_type=wpa&uin=qq号码&version=1&src_type=web&web_src=oicqzone.com\')          (URL Scheme  方式)
                }
            }else{
                if(u.toLowerCase().match(/MicroMessenger/i) == "micromessenger"){
                    window.open(\'http://wpa.qq.com/msgrd?v=3&uin=qq号码&site=qq&menu=yes\');
                }else{
                    window.open(\'mqqwpa://im/chat?chat_type=wpa&uin=qq号码&version=1&src_type=web&web_src=oicqzone.com\');        (URL Scheme  方式)
} }