I'm trying to check which default apps are installed on users phone.
I add to LSApplicationQueriesSchemes array strings with apps schemes names (for example "calc" for calculator), then I use this function to check:
func isAppInstalled(_ appName:String) -> Bool{
and use it like
but receive this error in console
This code work for appstore app, books, apple tv, facetime, messages etc but not working with calculator, time app, compass, contacts, tips.
What is wrong with my code? Or maybe Apple changed this apps schemes? Tested on iOS 14 device.
I add to LSApplicationQueriesSchemes array strings with apps schemes names (for example "calc" for calculator), then I use this function to check:
func isAppInstalled(_ appName:String) -> Bool{
Code Block let appScheme = "\(appName)://app" let appUrl = URL(string: appScheme) if UIApplication.shared.canOpenURL(appUrl! as URL){ return true } else { return false } }
and use it like
Code Block let result = isAppInstalled("calc")
but receive this error in console
canOpenURL: failed for URL: "calc://app" - error: "The operation couldn’t be completed. (OSStatus error -10814.)"
This code work for appstore app, books, apple tv, facetime, messages etc but not working with calculator, time app, compass, contacts, tips.
What is wrong with my code? Or maybe Apple changed this apps schemes? Tested on iOS 14 device.