Is there a function which I can use to check if the user has a particular app installed on their device. Ie, instagram
Asked
Active
Viewed 2,617 times
1 Answers
5
class func isAppInstalled(_ appName:String) -> Bool{
let appScheme = "\(appName)://app"
let appUrl = URL(string: appScheme)
if UIApplication.shared.canOpenURL(appUrl! as URL){
return true
} else {
return false
}
}
Add the name of the app you are checking to LSApplicationQueriesSchemes in your info.plist file
Jase Whatson
- 4,143
- 4
- 34
- 44