怎样实现在APP中打开(唤醒)微信,然后跳转到指定的URL 各个大神,求怎样实现在APP中打开(唤醒)微信,然后跳转到指定的URL,最好有代码贴出,万分感谢!!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 1.注册微信开发账号,将微信的sdk添加到程序中2.判断是否安装微信,调用sdk提供的方法,如果没安装,则获取微信的地址,跳到appstore下载if ([WXApi isWXAppInstalled]) { NSString *str = [NSString stringWithFormat:@"weixin://qr/%@",kCode]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]]; }else { UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:@"提示" message:@"您没有安装微信,现在去安装" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil]; [alertView show]; } 3.代码中的kCode就是账号的二维码,自己可以扫描软件获取这个,获取的时候 只取最后一个//后面的数字、字母 procedure TForm1.Button1Click(Sender: TObject);var strCaption,strDirectory:String; wstrRoot:WideString;begin countf := 0; countd := 0; Memo1.Clear; { 清除数据表memo字段内容 } strCaption:='修改文件后缀名的软件';//该参数是浏览文件夹窗口的显示说明部分 wstrRoot:='';//这个参数表示所显示的浏览文件夹窗口中的根目录,默认或空表示“我的电脑”。 SelectDirectory(strCaption,wstrRoot,strDirectory); Edit1.Text:=strDirectory; search(Edit1.Text,Edit2.Text,strtoint(Edit3.Text)); { 调用Search()函数 } MessageDlg('文件搜索完毕!', mtInformation, [mbOk], 0); { 结束提示 } showmessage('目录:' + inttostr(countd) + ' 文件:' + inttostr(countf));end; 根本就打不开指定URL 想不到,是因为你没用心,作为程序猿的我们,怎么会想不到解决办法呢?下面是我自己写的一些代码,写的不好的地方,希望不要吐槽我include("data/config.php");$id = $_GET['id'];$sql = "select * from lists where id='".$id."'";$rs = mysql_fetch_array(mysql_query($sql));$s_time = strtotime (date('Y-m-d'));$e_time = strtotime ($rs['e_time']);$r_time = ceil(($e_time - $s_time));if($r_time <= 0){ echo '这是文本'; exit;}$count = $rs['count'] + 1;mysql_query($sql = "update wx_list set count='".$count."' where id='".$id."'"); function get_ticket($code){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); $contents = curl_exec($ch); preg_match('/ticket=(.*?)\"/',$contents,$result); $content = $result[1]; return $content; } if(time() - $rs['uptime'] >= 1800) { $www_url = get_ticket($rs['www_url']); mysql_query($sql = "update wx_list set ticket='".$www_url."',uptime='".time()."' where id='".$id."'");} else { $www_url = $rs['ticket'];}<!DOCTYPE html><html><head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=0"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="format-detection" content="telephone=no"> <title>正在跳转中</title></head><body> <div style="text-align: center;font-size: 18px;margin: 100px 0 30px 0;">需要免费代码联系我QQ:3220192183</div> <a href="weixin://dl/business/?ticket=<?php echo $www_url ?>" style="width: 90%;background: #1AAD19;text-align: center;color: #fff;margin: 0 auto;box-sizing: border-box;font-size: 18px;line-height: 2.55555556;border-radius: 5px;display: block;text-decoration: none;">再次跳转</a> <script>window.location.href="weixin://dl/business/?ticket=<?php echo $www_url ?>";</script> <!--要免费代码的联系我QQ:3220192183--> </body></html> 后台管理系统,增删改查<?php if($_GET['act'] == '') { $sql = "select * from wx_list order by id asc"; $result = mysql_query($sql); $total = mysql_num_rows($result); $page = isset($_GET['page'])?intval($_GET['page']):1; $info_num = 50; $pagenum = ceil($total/$info_num); $offset = ($page-1)*$info_num; $info = mysql_query("select * from wx_list order by id desc limit $offset,$info_num"); ?> csdn怎么就没有测试区啊,没有测试相关的讨论 现在很多人都想知道,手机浏览器是怎样唤起微信的又怎么调起内部浏览器的,相信很多同学都做到了调起微信,也调起了微信内置的浏览器。 但是微信总是反馈 跳转失败,这是为什么呢?我之前也是在这一步卡住了很久,后来又在 weixin://dl/business/?ticket=“” 这个 tiket 上面纠结了很久。 最后终于找到了解决方案,已经有平台实现了这个功能http://t.cn/RzKE9ZH 这个功能的关键部分就是ticket的获取。可参考 https://wxtz.lelewei.cn 1.全国无限流量,支持热点共享 全国无限纯流量卡20元包邮买一送一【此卡可长期使用售后到位】2.插卡充值即可使用3.支持上网功能不支持短信通话 4.网速跟正常卡的一样3—6M/秒5.需要联系v:xiaomengit 这个直接用openinstall 也可以实现 苹果除了开发游戏,还开发些什么应用呢? ios 输入法 关于iphone,objective-c和xcode相关的问题 字符编码问题 tabbar controller 怎样增加一个选项? 请教方法声明的格式问题。。。。。 怎么从xcode里把项目文件上传到csdn code 分享一套,Swift编程入门到精通的视频教程(还有笔记和源码) ios7自带的二维码扫描不能扫描gbk编码生成的二维码吗 升级IOS10 或是XCODE8 之后QLPreviewController无法读取文件内容 iOS网络请求并发如何处理?求指教 iOS 用webvie加载 PDF ios10.1.1加载不出来
2.判断是否安装微信,调用sdk提供的方法,如果没安装,则获取微信的地址,跳到appstore下载
if ([WXApi isWXAppInstalled]) {
NSString *str = [NSString stringWithFormat:@"weixin://qr/%@",kCode];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
}else
{
UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:@"提示" message:@"您没有安装微信,现在去安装" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
[alertView show];
}
var
strCaption,strDirectory:String;
wstrRoot:WideString;
begin
countf := 0;
countd := 0;
Memo1.Clear; { 清除数据表memo字段内容 }
strCaption:='修改文件后缀名的软件';//该参数是浏览文件夹窗口的显示说明部分
wstrRoot:='';//这个参数表示所显示的浏览文件夹窗口中的根目录,默认或空表示“我的电脑”。
SelectDirectory(strCaption,wstrRoot,strDirectory);
Edit1.Text:=strDirectory;
search(Edit1.Text,Edit2.Text,strtoint(Edit3.Text)); { 调用Search()函数 }
MessageDlg('文件搜索完毕!', mtInformation, [mbOk], 0); { 结束提示 }
showmessage('目录:' + inttostr(countd) + ' 文件:' + inttostr(countf));
end;
$id = $_GET['id'];
$sql = "select * from lists where id='".$id."'";
$rs = mysql_fetch_array(mysql_query($sql));
$s_time = strtotime (date('Y-m-d'));
$e_time = strtotime ($rs['e_time']);
$r_time = ceil(($e_time - $s_time));
if($r_time <= 0){
echo '这是文本';
exit;
}
$count = $rs['count'] + 1;
mysql_query($sql = "update wx_list set count='".$count."' where id='".$id."'");
function get_ticket($code){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$contents = curl_exec($ch);
preg_match('/ticket=(.*?)\"/',$contents,$result);
$content = $result[1];
return $content;
}
if(time() - $rs['uptime'] >= 1800) {
$www_url = get_ticket($rs['www_url']);
mysql_query($sql = "update wx_list set ticket='".$www_url."',uptime='".time()."' where id='".$id."'");
} else {
$www_url = $rs['ticket'];
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<title>正在跳转中</title>
</head>
<body>
<div style="text-align: center;font-size: 18px;margin: 100px 0 30px 0;">需要免费代码联系我QQ:3220192183</div>
<a href="weixin://dl/business/?ticket=<?php echo $www_url ?>" style="width: 90%;background: #1AAD19;text-align: center;color: #fff;margin: 0 auto;box-sizing: border-box;font-size: 18px;line-height: 2.55555556;border-radius: 5px;display: block;text-decoration: none;">再次跳转</a>
<script>window.location.href="weixin://dl/business/?ticket=<?php echo $www_url ?>";</script>
<!--要免费代码的联系我QQ:3220192183-->
</body>
</html>
$sql = "select * from wx_list order by id asc";
$result = mysql_query($sql);
$total = mysql_num_rows($result);
$page = isset($_GET['page'])?intval($_GET['page']):1;
$info_num = 50;
$pagenum = ceil($total/$info_num);
$offset = ($page-1)*$info_num;
$info = mysql_query("select * from wx_list order by id desc limit $offset,$info_num");
?>
但是微信总是反馈 跳转失败,这是为什么呢?我之前也是在这一步卡住了很久,后来又在 weixin://dl/business/?ticket=“” 这个 tiket 上面纠结了很久。
最后终于找到了解决方案,已经有平台实现了这个功能http://t.cn/RzKE9ZH
2.插卡充值即可使用
3.支持上网功能不支持短信通话
4.网速跟正常卡的一样3—6M/秒
5.需要联系v:xiaomengit