본문 바로가기

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' 카테고리의 다른 글

Visual Attributed String(UILabel에 색상 지정)  (0) 2016.06.09
Tomcat+Jenkins+SonarQube for OSX  (0) 2016.06.02
APNs를 GCM으로 구현  (0) 2016.04.20
Expandable UITableView  (0) 2016.04.08
percent width in stroryborad  (0) 2016.03.28