如何检查iPhone设备上是否已安装特定应用程序? [英] How to check particular app is already installed on iphone device or not?

查看:59
本文介绍了如何检查iPhone设备上是否已安装特定应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何检查iphone设备上是否已安装特定应用程序? 我们如何实现这个想法?

How to check particular app is already installed on iphone device or not? How we can achieve this any idea?

推荐答案

canOpenURL本质上是检查是否已安装注册到该特定URL方案的应用程序,或者换句话说,是否存在该应用程序,以及是否已安装该应用程序,我们可以打开URL.

canOpenURL is the essentially checks whether the app that is registered to that particular URL scheme is installed or in other words if the app exists, and if it is, we can open the URL.

- (BOOL) appExists: (NSURL*)url{
    if ([[UIApplication sharedApplication] canOpenURL:url]) {        
        return YES;

    } else {
        return NO;
    }
}


NSURL *urlApp = [NSURL URLWithString:@"fb://profile/73728918115"];// facebook app

NSURL *urlApp = [NSURL URLWithString: [NSString stringWithFormat:@"%@", @"twitter:///user?screen_name=INNOVA_ET_BELLA"]];//tweeter app

if ([self appExists:urlApp]) {
        [[UIApplication sharedApplication] openURL:urlApp];
} 

iPhone URL方案:

IPhone URL Schemes:

http://wiki.akosma.com/IPhone_URL_Schemes

自定义URL方案:

http://mobiledevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html

这篇关于如何检查iPhone设备上是否已安装特定应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆