0

I want to bring the list of what apps are installed in my iPhone.

I hear this code sample is in this website but I can't find it.

Code Sample: Check if an app is installed - iDevKit: http://idevkit.com/forums/tutorials-code-samples-sdk/604-code-sample-check-if-app-installed.html

Can anyone give me a hint or how to get that code from the website?

Thanks.

Steve Ham
  • 3,067
  • 1
  • 29
  • 36
  • Swift-solution: https://stackoverflow.com/questions/53852623/how-to-get-the-list-of-applications-suitable-for-routing-from-the-user-s-device – Max Dec 22 '18 at 07:41

2 Answers2

2

This is not possible on non-jailbroken iOS devices—the app sandbox prevents it. You can test for some individual applications, if you know the URL schemes they implement (e.g. tel:// for the Phone app), by calling [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"someScheme://blah"]], but if an app doesn’t respond to any URL schemes then you’re not going to be able to determine whether it’s present on the device.

Noah Witherspoon
  • 57,021
  • 16
  • 130
  • 131
0

On a jailbroken device you can check against the apps binary:

-(BOOL)isWrightsCSInstalled
{
    return [[NSFileManager defaultManager] fileExistsAtPath:@"/Applications/WrightsCS.app/WrightsCS"];
}

Or, if you know the app has a custom URL Schema you can check if the URL can be opened:

- (BOOL) isTwitterInstalled 
{
    if ( [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"twitter://"]] )
        return YES;
    else
        return NO;
}
WrightsCS
  • 50,551
  • 22
  • 134
  • 186