标签:
URL Schemes关键字研究一下即可 常见得URL Schemes见http://www.cnblogs.com/huangzs/p/4491286.html
if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"alipay://"]])
{
NSLog(@" installed");
NSURL *url = [NSURL URLWithString:@"alipay://"];
[[UIApplication sharedApplication] openURL:url];
}
else
{
//提示用户去下载
UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"提示" message:@"支付宝未安装,是否去下载最新版本的支付宝?" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"下载",nil];
alert.tag=8789;
[alert show];
}
//警报0取消1下载
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
if (alertView.tag==8789) {
if (buttonIndex==0) {
return;
} else if (buttonIndex==1){
NSURL *url = [NSURL URLWithString:@"https://itunes.apple.com/cn/app/zhi-fu-bao-qian-bao-qiang/id333206289?mt=8"];
[[UIApplication sharedApplication] openURL:url];
}
}
}
标签:
原文地址:http://www.cnblogs.com/huangzs/p/4491316.html