Check if app installed

Hi all,

I was wondering if someone could help or point me in the right direction. Is there a way to check whether an app like Facebook is installed on the device? I wanted to create a hyperlink in my app and need to know if I should use the fb://profiles/xxx URL or

Any help is much appreciated.



@Stuart010, Here’s @zoyt’s example of opening apps with openUrl
and here’s a list of device/app urls .
Btw, welcome to the forums

There’s a better way. I don’t know the details, but with file IO in Lua you an get a list of the apps installed, by some ID. If you can find the ID that matches FaceBook and check for that folder, that’ll work. I’m sorry I don’t know the details.

@Zoyt i doubt you can get any app folder name without the jailbreak…? the basic protection in ios is that folder names are really complex.

@Jmv38 - Try fooling around with file IO like on this thread:
Try navigating outside your Documents folder. At least in iOS 6, it worked, but I don’t have my iPad to test it.

Here’s what I wrote, but I think Jmv is right about the set of numbers and letters being unique, and since I can’t get a list of directories in Applications to check them all, it isn’t really possible to find the right one.

function setup()

function downloadedFacebook()
    local rt = false
    local dirn = "private/var/mobile/Applications" .. "/B4E99996-DA19-417D-8D48-803CEE29D263/"
    local dire =, "r")
    if dire ~= nil then 
        rt = true

    return rt

@kirorp was partially right. I decided to look it up, and the best way to do it is test for is the app can be opened by its URL scheme (if the one your looking for has one). However, you need to make an Objective C add on to do that. Here’s the chunk of Objective C code to test a URL scene:

BOOL temp = [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"yourAppURL://"]];
    NSLog(@"INVALID URL"); //Or alert or anything you want to do here

Hope that helps!

Thanks guys, some good responses and something to think about. I’ll let you know how I get on.