美文网首页
iOS app中发起qq临时会话

iOS app中发起qq临时会话

作者: 小傑 | 来源:发表于2016-10-25 18:21 被阅读77次

    1.app中发起qq临时会话

    #import <TencentOpenAPI/QQApiInterface.h>
    #import <TencentOpenAPI/TencentOAuth.h>
    
    //1.判断是否有qq
            if (![QQApiInterface isQQInstalled]) {//这是qqAPI里的方法
                [MBProgressHUD showSuccess:@"请安装qq" toView:self.view];
                return;
            }
            
            //2.发起对话
            UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectZero];
            NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"mqq://im/chat?chat_type=wpa&uin=%@&version=1&src_type=web",qq号]];
            NSURLRequest *request = [NSURLRequest requestWithURL:url];
            [webView loadRequest:request];
            [self.view addSubview:webView];
    

    2.微信

    //1.//app跳入微信公众号页面
    if ([WXApi isWXAppInstalled]) {
            MyBonaServiceModel *model = self.array_model[indexPath.section];
            JumpToBizProfileReq *jumpReq = [[JumpToBizProfileReq alloc] init];
            jumpReq.username = model.number;
            jumpReq.extMsg = @"哈哈";
            jumpReq.profileType = WXBizProfileType_Normal;
           [WXApi sendReq:jumpReq];
        }
    

    相关文章

      网友评论

          本文标题:iOS app中发起qq临时会话

          本文链接:https://www.haomeiwen.com/subject/bowruttx.html