如何在iPhone设备上检查已安装的应用程序 [英] How To Check Installed Application On iPhone Device

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

问题描述

我正在开发一个应用程序,我需要在其中找到已经安装在iPhone设备上的应用程序 - 例如Skype,Facebook。

I am developing an application in which I need to find the apps - such as Skype, Facebook - which are already installed on the iPhone device.

我需要检查一下Objective-C。如果可能的话,请给我一个代码片段;否则是解决方案的链接。

I need to check it Objective-C. Please give me a code snippet if possible; otherwise a link to the solution.

如果不可能,请告诉我另一种检查iPhone设备上安装的应用程序的方法。

If it not possible then tell me another way to check installed application on iPhone device.

提前致谢。

推荐答案

如果您要检查的应用程序已注册了URI方案,您可以进行探测,并假设该应用是安装。看看 - (BOOL)canOpenURL:(NSURL *)网址,尝试一下

If the app you're checking for has a URI scheme registered, you can probe for that and assume the app is installed. Have a look at -(BOOL)canOpenURL:(NSURL *)url, try something along the lines of

if ( [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"fb://"]] )
{
     NSLog(@"will open facebook urls");
}

然而,这并不保证正版Facebook应用会响应fb://

However, this does not give the guarantee that the genuine facebook app will respond to fb://

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

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