Swift 2 - sharedApplication() - Apple Music 搜索 Api

Swift 2 - sharedApplication() - Apple Music Search Api

我正在尝试使用 UIApplication.sharedApplication().openURL 从我的应用程序 Apple Music 应用程序打开并搜索艺术家或让 link 打开歌曲所在的相关页面。

是否有 api 我可以用来在 Apple Music 应用程序上进行搜索的应用程序?这可能吗?

let test = "https://itun.es/gb/RJEL2?i=915794180"
UIApplication.sharedApplication().openURL(NSURL(string:test)!)

如果我使用 link 应用程序打开但没有任何反应。

如果

let test = "https://itun.es/gb/RJEL2?i=915794180"

包含你的搜索信息你可以得到url这样的内容

let Session = NSURLSession.SharedSession()
var task = Session.dataTaskWithURL(test, completionHandler: {
   (data, response, error) -> Void in

   :
})
task.resume()