I am trying to check if a user has installed a couple of apps. I need it to work on ios9 and ios 10.
I am testing on ios9 first and the schemeAvailable
func is returning true even though the app passed
is not installed on the device.
func schemeAvailable(scheme: String) -> Bool {
if let url = URL(string: scheme) {
return UIApplication.shared.canOpenURL(url)
}
return false
}
I have added the following to my info.plist i.e. the apps I will check are installed:
<key>LSApplicationQueriesSchemes</key>
<array>
<string>app1</string>
<string>app2</string>
</array>
and in my project's info tab, I have added 2 url types and inserted the identifier and url scheme for each.