zoukankan      html  css  js  c++  java
  • 如何判断ios设备中是否安装了某款应用

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

            }

        }

        

    }

  • 相关阅读:
    Regexp:教程
    Regexp:目录
    笔记-C#:C# 方法、属性杂项-01
    Regexp:正则表达式应用——实例应用
    正则表达式:百科
    Regexp:template
    AngularJS:参考手册
    命令目录
    java实现连续数的公倍数
    java实现连续数的公倍数
  • 原文地址:https://www.cnblogs.com/huangzs/p/4491316.html
Copyright © 2011-2022 走看看