1

I have implemenetd to play iTunes songs from my tvOS application. I wants to give the feature to purchase songs from my application for this i have following code -

var iTunesLink = "https://itunes.apple.com/us/album/crazy-naked-girls/id310568758?i=310568759&uo=4&at=xxxxxxWa&app=itunes";

if let appStoreURL = NSURL(string: iTunesLink as String) {
    if (UIApplication.sharedApplication().canOpenURL(appStoreURL) == true) {
        UIApplication.sharedApplication().openURL(appStoreURL)
    }
}

but this line UIApplication.sharedApplication().canOpenURL(appStoreURL) always giving false value.

Daniel Storm
  • 18,301
  • 9
  • 84
  • 152
Anupam Mishra
  • 3,408
  • 5
  • 35
  • 63
  • dude, can you try itms link than a http one ? – thndrkiss Aug 01 '16 at 10:27
  • @thndrkiss 'itms-apps://itunes.apple.com/us/album/crazy-naked-girls/id310568758?i=310568759&uo=4&at=xxxxxxWa&app=itunes' redirects me on itms store, I wants to redirect on iTunes store, so that i can buy songs from iTunes. – Anupam Mishra Aug 01 '16 at 13:41

0 Answers0