본문 바로가기

Programming/iOS

how to check if an app is installed

반응형

First, you'll need to 'whitelist' the URL by adding the following to your Info.plist file (a security feature--see Leo Natan's answer):

<key>LSApplicationQueriesSchemes</key>

<array>
    <string>fb</string>
</array>

 

After that, you can ask whether the app is available and has a registered scheme:

guard UIApplication.sharedApplication().canOpenURL(NSURL(string: "fb://")!) else {
    NSLog("No Facebook?  You're a better man than I am, Charlie Brown.")
    return
}

 

 

출처

http://stackoverflow.com/questions/3512228/how-to-check-programatically-if-an-app-is-installed

반응형

'Programming > iOS' 카테고리의 다른 글