ios或mac程序中添加链接到评价页面的方法

转载 2012年03月21日 14:07:42

Dissecting iTunes, App Store and Mac App Store links

For the latest release of Consume, we wanted to include two buttons: one that linked to all our apps on the App Store, and another that let users easily write a review on iTunes.

These both seem like common things iOS developers would want to do, so we decided to share the results of our research. Some of the information contained below is obvious for experienced iTunes users, while other links are rarer.

Copying links from iTunes

Most links can be copied directly from iTunes. Simply right click (Mac & PC) or control-click (Mac) on a button or linked text in iTunes and select Copy Link.

http://itunes.apple.com/genre/mobile-software-applications/id36?mt=8 — App Store home
http://itunes.apple.com/genre/mobile-software-applications/id6014?mt=8 — Games
http://itunes.apple.com/genre/mobile-software-applications/id6002?mt=8 — Utilities
http://itunes.apple.com/app/consume-mobile-isp-packages/id337064413?mt=8 — An app

These links all function as you’d expect on a Mac, PC, iPad, iPhone and iPod.

iTunes Link Maker

Apple provide a great tool for creating iTunes links, aptly named iTunes Link Maker. It lets you create all kinds of URLs, including a direct link to an artist.

http://itunes.apple.com/au/artist/the-chemical-brothers/id3726283

On Mac or Windows, this link will open your web browser (if you're not already in it), then open iTunes and the artist’s page (The Chemical Brothers, in this case). On an iOS device, the link opens iTunes and loads the artist’s page. iTunes Link Maker tool also lets you create a link to a developer’s apps.

http://itunes.apple.com/us/artist/bjango/id290155421?uo=6

The link functions as expected on iTunes for Mac and Windows, opening up the developer’s page. Unfortunately, it doesn’t work on iOS devices—it opens the iTunes app then gives an error. This is probably because the App Store app doesn’t actually have a page that lists all apps by a developer.

There is a way around the problem though.

Searching and linking with iTunes.com

iTunes.com URLs provide a great method for jumping to search results or directly to an item. If the search produces multiple results, you’ll land on a search results page. If the search produces a single result, then you’ll be taken directly to the item.

http://itunes.com/search — Search for search

This searches for songs, movies, TV shows, artists, developers or any item on the iTunes Store. If the name of the item you’re linking to contains spaces or punctuation, you’ll need to strip them out. You might have issues using this method to link to a single item for common names, as they’ll yield multiple results (try a search for “Dreams” or “Party” if you don’t believe me).

http://itunes.com/artist/song — Link to song by artist
http://itunes.com/artist/album — Link to album by artist
http://itunes.com/movie/moviename — Search for moviename
http://itunes.com/tv/tvshow — Search for tvshow
http://itunes.com/apps/app — Link to app
http://itunes.com/apps/developer/app — Link to app by developer

Using specific URLs is more likely to produce one result, ending up where you intended.

http://itunes.com/apps/developer — Search for all apps by developer

It’s also possible to link to all apps by one developer, but there’s a catch. On a Mac or a PC, this will open iTunes and land on a developer’s page. On an iOS device it’ll do a bit of a dance, opening MobileSafari, then iTunes, then the App Store app. Not ideal, a bit ugly and slow, but it gets there in the end.

If you’d like to hide the redirections and speed up the process, Apple recommend using NSURLConnection.

Mac App Store updates

To open the Mac App Store app and select the Updates tab, use the URL below.

macappstore://showUpdatesPage

Heading straight to a review form

It’s also possible to send someone straight to the review form for an app.

https://userpub.itunes.apple.com/WebObjects/MZUserPublishing.woa/wa/addUserReview?id=337064413&type=Purple+Software

Simply replace the ID with your app’s ID to create a URL for your app.

On a desktop or laptop, this will take you directly to the review form in iTunes for the app or item. On an iOS device, this will open MobileSafari, then open iTunes or the App Store app on the reviews page, leaving the user only one tap away from writing a review.

Update: iOS 4.2 seems to have fixed this and links now open the App Store app directly.

To find out an item’s ID, right (Mac & PC) or control-click (Mac) on a link to the item in iTunes and select Copy Link. The result will look something like this.

http://itunes.apple.com/au/album/dig-your-own-hole/id19605549
http://itunes.apple.com/au/app/consume-mobile-isp-packages/id337064413?mt=8

The ID is the number in the URL after “id’.

It might be worth noting that this URL was created using iTunes 8. I don't think there’s a way to create review links in iTunes 9, so maybe this URL is being phased out. Use with caution.

Update: @mareMtl has provided an alternative review link for apps. Please note that it only works on iOS devices.

itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=337064413

Linking to a specific promo code

To create a direct link to open iTunes and redeem a promo code, replace the “RWAPJ7XLTHN7” portion of the URL below with your promo code.

https://phobos.apple.com/WebObjects/MZFinance.woa/wa/freeProductCodeWizard?code=RWAPJ7XLTHN7

Hat tip to Scott Meinzer for working this one out.

Final results

And the winners are...

http://itunes.com/apps/bjango — Search for all our apps

https://userpub.itunes.apple.com/WebObjects/MZUserPublishing.woa/wa/addUserReview?id=337064413&type=Purple+Software — Go to Consume’s review form

Due to some of the redirecting that takes place on an iOS, using URL shorteners can break links. So, be sure to check before using them on Twitter or Facebook.

IOS 添加评论功能

IOS 评论功能添加
  • liuyinghui523
  • liuyinghui523
  • 2015年09月10日 13:43
  • 947

(原创)ios提示用户去AppStore好评逻辑

一:首先文件头要引入UIAlertViewDelegate@interface ZTIndexViewController (){ UIAlertView *alertViewTest; }二...
  • z040145
  • z040145
  • 2015年08月11日 17:42
  • 2512

iOS应用内跳转到App Store详情页或者评论页

要想在App内跳转到特定App的详情页或者评论页,首先需要获取到App的id。在iTunes Connect网站上登陆之后,选择“我的App”,然后点击某个特定的App进入,在App信息的综合信息中,...
  • u012894479
  • u012894479
  • 2016年02月25日 17:24
  • 3445

【iOS】iOS10.3新增API:应用内评分

1、需求在iOS10.3以前,APP引导用户评分时需要跳转到AppStore中操作,并且AppStore在国内有时加载会较慢,即便有的用户想给APP好评,但是等了几秒钟评分页面还没加载出来从而放弃。在...
  • dolacmeng
  • dolacmeng
  • 2017年04月14日 13:49
  • 6526

app 评论功能实现

//应用实现评论跳转的两种方法: //第一种: //在iOS6.0前跳转到AppStore评分一般是直接跳转到AppStore评分 //NSString *evaluateString = [N...
  • zhaoyya
  • zhaoyya
  • 2014年12月15日 10:56
  • 1262

iOS 获得UIWebView的content高度,添加评论功能

UIWebView内容高度的获取,项目实现H5文章&原生评论效果,文章是加载H5链接,评论信息是后台接口提供,以列表形式展示。 实现思路: 1. webView加载H5链接,设置它为tableView...
  • d18513256401
  • d18513256401
  • 2017年07月28日 09:57
  • 145

iOS 中对 HTTPS 证书链的验证

这篇文章是我一边学习证书验证一边记录的内容, 稍微整理了下,共扯了三部分内容: HTTPS 简要原理;数字证书的内容、生成及验证;iOS 上对证书链的验证。 HTTPS 概要 HTTP...
  • u010500895
  • u010500895
  • 2017年02月18日 23:36
  • 618

iOS开发中webview加载https

WebView加载HTTPS              由于后台服务器接口都换成了https,所以在项目中请求数据也用了AFN的session类,但是突然发现一个问题,数据倒是请求到了,但是某些链接加...
  • whjay520
  • whjay520
  • 2016年12月19日 16:50
  • 1837

【iOS_GitHub】评分条/星级条(类似于淘宝/京东/1号店/亚马逊等商城类的评分条,支持0.5分哦)

RatingBar评分条(类似于淘宝/京东/1号店/亚马逊等商城类的评分条,支持0.5分哦)先上图,看一下是否符合你的场景吧!  Function Description 点击评分; 滑动评分; 个...
  • Anticipate91
  • Anticipate91
  • 2016年12月08日 13:43
  • 1132

给IOS项目添加图标和启动页

今天早上按以前的步骤给项目添加图标的时候发现并不能实现,网上的教程也是众说纷纭,后来才知道这其实是x-code升级的缘故。废话不多说,下面进入正题! 给程序添加启动图标: ...
  • IOS_dashen
  • IOS_dashen
  • 2015年06月12日 14:40
  • 789
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:ios或mac程序中添加链接到评价页面的方法
举报原因:
原因补充:

(最多只允许输入30个字)