nivrutti
nivrutti

Reputation: 297

How To Check Installed Application On iPhone Device

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.

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

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

Thanks in advance.

Upvotes: 5

Views: 4157

Answers (2)

Steve Ham
Steve Ham

Reputation: 3154

    if ([[NSFileManager defaultManager] fileExistsAtPath:@"/Applications/Cydia.app"])

Upvotes: 1

mvds
mvds

Reputation: 47034

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");
}

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

Upvotes: 7

Related Questions