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

            }

        }

        

    }

  • 相关阅读:
    红外应用
    电池分类及特点
    温湿度传感器AM2302(DH22)
    lora
    跳频扩频技术学习
    STM32F4/F7运算性能
    物联网相关模块
    DC-DC芯片
    外部引用CSS中 link与@import的区别
    超酷实用的jQuery焦点图赏析及源码
  • 原文地址:https://www.cnblogs.com/huangzs/p/4491316.html
Copyright © 2011-2022 走看看