首页 > 移动平台 > 详细

如何判断ios设备中是否安装了某款应用

时间:2015-05-09 23:29:17      阅读:1388      评论:0      收藏:0      [点我收藏+]

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];

        }

    }

    

}

如何判断ios设备中是否安装了某款应用

原文:http://www.cnblogs.com/huangzs/p/4491316.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!