iPhone代码:

- (BOOL)joinGroup:(NSString *)groupUin key:(NSString *)key{
NSString *urlStr = [NSString stringWithFormat:@"mqqapi://card/show_pslcard?

src_type=internal&version=1&uin=%@&key=%@&card_type=group&source=external", @"xxx",@"xxx"]; NSURL *url = [NSURL URLWithString:urlStr]; if([[UIApplication sharedApplication] canOpenURL:url]){ [[UIApplication sharedApplication] openURL:url]; return YES; } else return NO; }

Android代码:

/****************
*
* 发起加入群流程。QQ群的 key 为: -xxx
* 调用 joinQQGroup(-xxx) 就可以发起手Qclient申请加群 
*
* @param key 由官网生成的key
* @return 返回true表示呼起手Q成功,返回fals表示呼起失败
******************/
public boolean joinQQGroup(String key) {
    Intent intent = new Intent();
    intent.setData(Uri.parse("mqqopensdkapi://bizAgent/qm/qr?

url=http%3A%2F%2Fqm.qq.com%2Fcgi-bin%2Fqm%2Fqr%3Ffrom%3Dapp%26p%3Dandroid%26k%3D" + key)); // 此Flag可依据详细产品须要自己定义,如设置,则在加群界面按返回,返回手Q主界面,不设置,按返回会返回到呼起产品界面 //intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) try { startActivity(intent); return true; } catch (Exception e) { // 未安装手Q或安装的版本号不支持 return false; } }

网页代码:

<a target="_blank" href="http://shang.qq.com/wpa/qunwpa?idkey=xxx"><img border="0" src="http://pub.idqqimg.com/wpa/images/group.png" alt="xx用户群" title="xx用户群"></a>

參考:http://qun.qq.com/join.html