天天看點

xcode中原生iOS封裝代碼通路QQ客服

把下面代碼放入某個插件的.m檔案裡封裝的方法(這裡以clipboard複制插件為列)裡,然後跳用該方法即可跳轉QQ系統調用QQ對話框

NSArray* array = [text componentsSeparatedByString:@","];
        if([array[] isEqual:@"複制"] && [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"mqq://"]])
        {
            NSString *QQ = array[];
            NSString *url = [NSString stringWithFormat:@"mqq://im/chat?chat_type=wpa&uin=%@&version=1&src_type=web",QQ];
            [[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
            return ;
        }

  [pasteboard setValue:text forPasteboardType:@"public.text"];
           
xcode中原生iOS封裝代碼通路QQ客服

在xcode info中添加

LSApplicationQueriesSchemes

格式設定為Array,添加item值為

mqq