I want to link from my app directly to the app store.
I am using this code:
var url = NSURL(string: "itms-apps://itunes.com/apps/companyname/appname")
if UIApplication.sharedApplication().canOpenURL(url!) == true {
UIApplication.sharedApplication().openURL(url!)
}
When the name of the app has no space in it, it works fine. But is there is a space in the app name, It does not link to the app itself, but it links to the page with all my apps. How come?
Example: if app name = bobbie , I use:
var url = NSURL(string: "itms-apps://itunes.com/apps/mycompany/bobbie")
if UIApplication.sharedApplication().canOpenURL(url!) == true {
UIApplication.sharedApplication().openURL(url!)
}
(works prefectly)
But it app name = bob bie , I use:
var url = NSURL(string: "itms-apps://itunes.com/apps/mycompany/bob-bie")
if UIApplication.sharedApplication().canOpenURL(url!) == true {
UIApplication.sharedApplication().openURL(url!)
}
But this doesn't link to the app...