I have made a demo project App1 in which I added a button which will redirect me to the installed app suppose App2("fitbit") I have gone through many tutorials and basically got the idea how to do this through the 2nd answer "This app is not allowed to query for scheme cydia" IOS9 error .but got stucked at a point where I need to mention URL Scheme of App2("fitbit") at LSApplicationQueriesSchemes in App1.
So basically the question is how to get the URL Schemes of the apps like fitbit.
and here are my codes
var url = NSURL(string: "itms://itunes.apple.com/in/app/fitbit/id462638897?mt=8")
@IBAction func redirectOnclick(_ sender: Any) {
let urlFitBt = NSURL(string: "fitbit://")
if UIApplication.shared.canOpenURL(urlFitBt! as URL)
{
UIApplication.shared.open(urlFitBt! as URL)
}
else
{
UIApplication.shared.open(url! as URL)
}
}
Use like this
swift 2.2
and add this line into info.plist