开发者

How does itunes.apple.com open the application iTunes on OS X?

Is that a special API? I noticed Chrome and Firefox also do it. Is this something that is baked 开发者_如何学编程in that gives iTunes and requests from that domain a special relationship?


You don't always know if iTunes or Mac App Store are installed on the users computer so you cannot rely on itms:// or macappstore:// links.

The better way to do this is:

  1. Append "ls=1" to any iTunes link. The iTunes Preview page will open and if iTunes is installed, the store will open directly to the content you linked to.

    If the link doesn't have URL params, add "?ls=1"
    https://itunes.apple.com/us/album/rick-astley-the-greatest-hits/id299608177?ls=1

    If the link does have URL params, add "&ls=1"
    https://itunes.apple.com/us/album/never-gonna-give-you-up/id299608177?i=299608205&ls=1

  2. Use affiliate program links. Any iTunes link with affiliate program parameters will automatically open the iTunes store to the content you want (sans "ls=1").

    http://www.apple.com/itunes/affiliates/resources/


iTMS links are used to refer to iTunes stuff. For different type of links (protocols), browsers can open applications associated with those protocols and pass that link to those applications. All modern browsers are aware of itms:// links and open iTunes or, say, Rhythmbox players. Also check out iTunes Link Maker.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜