[英]ITunes review URL and iOS 7 (ask user to rate our app) AppStore show a blank page
Does anybody knows if the technique used to ask the user to rate our app and open for him the App Store directly on the rating page is still working on iOS 7 ? 有谁知道用于要求用户评价我们的应用程序并直接在评级页面上为他打开App Store的技术是否仍在iOS 7上运行?
I used to open this url from my app : 我曾经从我的应用程序打开这个网址:
itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=353372460&onlyLatestVersion=true&pageNumber=0&sortOrdering=1&type=Purple+Software
But it looks like it's not working anymore (AppStore show a blank page). 但看起来它不再起作用了(AppStore显示空白页面)。 I have also tried this url wihout luck:
我也试过这个网址,但没有运气:
http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?pageNumber=0&sortOrdering=1&type=Purple+Software&mt=8&id=353372460
Starting with iOS7 the URL has changed and cannot direct for the review page but only to the app 从iOS7开始,URL已更改,无法指向审阅页面,只能指向应用程序
itms-apps://itunes.apple.com/app/idAPP_ID
Where APP_ID need to be replaced with your Application ID. APP_ID需要替换为您的应用程序ID。 Based on the App ID from the question it would be the following
根据问题中的App ID,它将如下所示
itms-apps://itunes.apple.com/app/id353372460
Notice the id in front of the number ... that string is is id 353372460, not just 353372460 注意数字前面的id ...该字符串是id 353372460,而不仅仅是353372460
For anything pre iOS7 the 'old' URL needs to be used, only those could get you straight to the review page. 对于iOS7之前的任何内容,需要使用“旧”URL,只有那些可以直接进入评论页面。 You should also take note that these calls will only work on devices .
您还应注意,这些调用仅适用于设备 。 Running them in the simulator will do nothing since the simulator does not have the App Store app installed.
由于模拟器没有安装App Store应用程序,因此在模拟器中运行它们将无效。
Have a look at for instance Appirater for an implementation. 请查看Appirater实例。 https://github.com/arashpayan/appirater
https://github.com/arashpayan/appirater
Can't help you with phonegap specifics (never used it). 无法帮助您使用phonegap细节(从未使用过它)。 But it basically comes down to checking the iOS version your user is running and then either use the old URL or then new iOS7 URL.
但它基本上归结为检查用户正在运行的iOS版本,然后使用旧URL或新的iOS7 URL。
The following URL works perfectly on iOS 7.1: 以下URL在iOS 7.1上完美运行:
http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=xxxxxxxx&pageNumber=0&sortOrdering=2&type=Purple+Software&mt=8
where the xxxxxxxx
is your app ID. 其中
xxxxxxxx
是您的应用ID。
UPDATE . 更新 。 Works on iOS 9.3.4 and iOS 10 GM (by Jeet)
适用于iOS 9.3.4和iOS 10 GM(由Jeet提供)
This works on my end (Xcode 5 - iOS 7 - Device !): 这适用于我(Xcode 5 - iOS 7 - 设备 !):
itms-apps://itunes.apple.com/app/idYOUR_APP_ID
For versions lower than iOS 7 use the old one: 对于低于iOS 7的版本,请使用旧版本:
itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=YOUR_APP_ID
One-Line-of-Code Simple Alternative: ** Also See Simulator Comments Below ** 单行代码简单替代方案: **另见下面的模拟器评论**
http://itunes.apple.com/app/idAPP_ID
EDIT: Now that iOS 7.1 allows direct-link to the Reviews tab in the App Store, it's worth investing the extra lines of code to get there directly: see other answers for the rest. 编辑:既然iOS 7.1允许直接链接到App Store中的评论标签,那么值得投入额外的代码行直接到达那里:其余的请参见其他答案。
here we are using http:
instead of itms-apps:
, let iOS do the rest of the work 这里我们使用
http:
而不是 itms-apps:
, 让iOS完成剩下的工作
I get the same results testing on iOS 6.1 & 7 devices (iPad/iPhone/iPod touch 4) 我在iOS 6.1和7设备(iPad / iPhone / iPod touch 4)上获得相同的结果测试
Specifically, this shortcut , for iOS 6 takes the user to the Details
tab and not the Reviews
tab. 具体来说,对于iOS 6 ,此快捷方式将用户带到“
Details
选项卡,而不是“ Reviews
选项卡。
The Purple+Software
link gets the user all the way to the Reviews tab in iOS 6, which is obviously preferred if you know how to check the OS. Purple+Software
链接将用户一直带到iOS 6中的Reviews选项卡,如果您知道如何检查操作系统,这显然是首选。
Important note : This will cause error in the simulator for iOS 5.1, 6.1 and 7. 重要说明 :这将导致iOS 5.1,6.1和7的模拟器出错。
Cannot Open Page Safari can not open the page because the address is invalid (we know it is a valid URL outside the simulator, on any browser) 无法打开页面Safari无法打开页面,因为地址无效(我们知道它是模拟器外的任何浏览器上的有效URL)
Just to be clear : On iOS 7: http://
provides the same experience as itms-apps:
with no noticeable delay. 需要明确的是 :在iOS 7上:
http://
提供与itms-apps:
相同的体验itms-apps:
没有明显的延迟。
* keep in mind that the simulator behavior noted above. *请记住上面提到的模拟器行为。 This is not entire dissimilar from trying to access the camera via a simulator: the simulator is not the place to test it.
这与尝试通过模拟器访问摄像机并不完全不同:模拟器不是测试它的地方。 *
*
Opening review page directly from app is possible in iOS7. 可以在iOS7中直接从应用程序打开评论页面。 Please use the following url...
请使用以下网址...
itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=YOUR_APP_ID
This will definitely works.. :) 这肯定会有效.. :)
It's not clear which versions of iOS this is supported by, but as part of iOS 10.3 there's a new query parameter that can be added to the URL: action=write-review
. 目前尚不清楚支持哪种版本的iOS,但作为iOS 10.3的一部分,可以添加一个新的查询参数到URL:
action=write-review
。 I have tested this on iOS 10.2 and 9.3.5 and it works. 我已经在iOS 10.2和9.3.5上测试了这个并且它可以工作。 However, it does not work on iOS 7.1.2, so support was added between iOS 8.0 and 9.3.5.
但是,它在iOS 7.1.2上不起作用,因此在iOS 8.0和9.3.5之间添加了支持。 Further investigation is required!
需要进一步调查!
Example: https://itunes.apple.com/app/id929726748?action=write-review&mt=8 示例: https : //itunes.apple.com/app/id929726748?action = write-review&mt = 8
This will open the "Write a Review" dialogue , rather than just showing the review tab. 这将打开“撰写评论”对话框 ,而不是仅显示评论标签。
+ (NSString *)getReviewUrlByAppId:(int)appId
{
NSString *templateReviewURL = @"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=APP_ID";
NSString *templateReviewURLiOS7 = @"itms-apps://itunes.apple.com/app/idAPP_ID";
NSString *templateReviewURLiOS8 = @"itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=APP_ID&onlyLatestVersion=true&pageNumber=0&sortOrdering=1&type=Purple+Software";
//ios7 before
NSString *reviewURL = [templateReviewURL stringByReplacingOccurrencesOfString:@"APP_ID" withString:[NSString stringWithFormat:@"%d", appId]];
// iOS 7 needs a different templateReviewURL @see https://github.com/arashpayan/appirater/issues/131
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0 && [[[UIDevice currentDevice] systemVersion] floatValue] < 7.1)
{
reviewURL = [templateReviewURLiOS7 stringByReplacingOccurrencesOfString:@"APP_ID" withString:[NSString stringWithFormat:@"%d", appId]];
}
// iOS 8 needs a different templateReviewURL also @see https://github.com/arashpayan/appirater/issues/182
else if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
{
reviewURL = [templateReviewURLiOS8 stringByReplacingOccurrencesOfString:@"APP_ID" withString:[NSString stringWithFormat:@"%d", appId]];
}
return reviewURL;
}
The review link has once again broken in iOS9. iOS9中的评论链接再次破裂。 In doing some experimenting, I figured out that Apple reverted it back to how it was before iOS7.
在进行一些实验时,我发现Apple将其恢复到iOS7之前的状态。 So you have to do:
所以你必须这样做:
itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=247423477&onlyLatestVersion=true&pageNumber=0&sortOrdering=1&type=Purple+Software
Where 247423477
is your 9 digit app ID (the main difference is you have to append &onlyLatestVersion=true&pageNumber=0&sortOrdering=1&type=Purple+Software
after the app ID). 其中
247423477
是您的9位应用程序ID(主要区别在于您必须追加&onlyLatestVersion=true&pageNumber=0&sortOrdering=1&type=Purple+Software
app ID)。
All the answers above have now been deprecated (iOS 7, but may work) thus, I provide the new way Apple recommends to provide links to the Apps. 上面的所有答案现已被弃用(iOS 7,但可能有效),因此,我提供Apple建议提供应用程序链接的新方式。 The link for your App is the one from iTunes (use Copy Link), this one is recommended for use in code:
您的应用程序的链接是iTunes中的链接(使用复制链接),建议在代码中使用此链接:
Swift 3.0 Swift 3.0
let path = URL(string: "https://itunes.apple.com/us/app/calcfast/id876781417?mt=8")
UIApplication.shared.open(path!)
Or better -- treat the optional correctly and handle the possibility of not being able to reach the link: 或者更好 - 正确对待可选项并处理无法访问链接的可能性:
if let path = URL(string: "https://itunes.apple.com/us/app/calcfast/id876781417?mt=8") {
UIApplication.shared.open(path) {
(didOpen:Bool) in
if !didOpen {
print("Error opening:\(path.absoluteString)")
}
}
}
Objective-C Objective-C的
#define APP_URL_STRING @"https://itunes.apple.com/us/app/calcfast/id876781417?mt=8"
then you can call APP_URL_STRING
in your code: 然后你可以在你的代码中调用
APP_URL_STRING
:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: APP_URL_STRING] options:@{} completionHandler:nil];
Note, that this is the recommended way now by Apple, as the previous method of processing redirect links has been deprecated and are not supported. 请注意,这是Apple现在推荐的方式,因为之前处理重定向链接的方法已被弃用且不受支持。
The link for all your Apps, if you have more than one: 所有应用的链接,如果您有多个应用:
#define MYCOMPANY_URL_PATH @"http://appstore.com/mycompany"
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: MYCOMPANY_URL_PATH] options:@{} completionHandler:nil];
The App link above is recommended for use in code or links that are not seen directly by the user. 建议将上面的App链接用于代码或用户未直接看到的链接。 If you want to provide link that may be seen and remembered by the user then use the following:
http://appstore.com/calcfast
如果您想提供用户可以看到和记住的链接,请使用以下内容:
http://appstore.com/calcfast
: http://appstore.com/calcfast
Using this URL was the perfect solution for me. 使用此URL是我的完美解决方案。 It takes the user directly to the
Write a Review section
. 它将用户直接带到
Write a Review section
。 Credits to @Joseph Duffy. @Joseph Duffy的积分。
For a sample code try this : 有关示例代码,请尝试:
Swift 3, Xcode 8.2.1 : Swift 3,Xcode 8.2.1:
let openAppStoreForRating = "itms-apps://itunes.apple.com/gb/app/id1136613532?action=write-review&mt=8"
if UIApplication.shared.canOpenURL(URL(string: openAppStoreForRating)!) {
UIApplication.shared.openURL(URL(string: openAppStoreForRating)!)
} else {
showAlert(title: "Cannot open AppStore",message: "Please select our app from the AppStore and write a review for us. Thanks!!")
}
Here showAlert is a custom function for an UIAlertController
. 这里showAlert是一个自定义函数
UIAlertController
。
I have this to get the Product ID automatically and generate App Store Review and Product page links . 我有这个来自动获取产品ID并生成App Store Review和Product页面链接 。
- (void) getAppStoreLinks {
productID = [[NSUserDefaults standardUserDefaults] objectForKey:@"productID"]; //NSNumber instance variable
appStoreReviewLink = [[NSUserDefaults standardUserDefaults] objectForKey:@"appStoreReviewLink"]; //NSString instance variable
appStoreLink = [[NSUserDefaults standardUserDefaults] objectForKey:@"appStoreLink"]; //NSString instance variable
if (!productID || !appStoreReviewLink || !appStoreLink) {
NSString *iTunesServiceURL = [NSString stringWithFormat:@"https://itunes.apple.com/lookup?bundleId=%@", [NSBundle mainBundle].bundleIdentifier];
NSURLSession *sharedSes = [NSURLSession sharedSession];
[[sharedSes dataTaskWithURL:[NSURL URLWithString:iTunesServiceURL]
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
NSInteger statusCode = ((NSHTTPURLResponse *)response).statusCode;
if (data && statusCode == 200) {
id json = [[NSJSONSerialization JSONObjectWithData:data options:(NSJSONReadingOptions)0 error:nil][@"results"] lastObject];
//productID should be NSNumber but integerValue also work with NSString
productID = json[@"trackId"];
if (productID) {
appStoreReviewLink = [NSString stringWithFormat:@"itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=%d&pageNumber=0&sortOrdering=2&type=Purple+Software&mt=8",productID.integerValue];
appStoreLink = [NSString stringWithFormat:@"itms-apps://itunes.apple.com/app/id%d",productID.integerValue];
[[NSUserDefaults standardUserDefaults] setObject:productID forKey:@"productID"];
[[NSUserDefaults standardUserDefaults] setObject:appStoreReviewLink forKey:@"appStoreReviewLink"];
[[NSUserDefaults standardUserDefaults] setObject:appStoreLink forKey:@"appStoreLink"];
}
} else if (statusCode >= 400) {
NSLog(@"Error:%@",error.description);
}
}
] resume];
}
}
Open app's Review Page 打开应用程序的评论页面
- (IBAction) rateButton: (id)sender {
NSString *appStoreReviewLink = appStoreReviewLink;
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:appStoreReviewLink]];
}
Open app's App Store page 打开应用程序的App Store页面
- (IBAction) openAppPageButton: (id)sender {
NSString *appStoreLink = appStoreLink;
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: appStoreLink]];
}
It is said that this bug will be fixed on iOS7.1. 据说这个bug将在iOS7.1上修复。 Read here on the corona forum, and here on the iPhoneDevSDK .
请阅读日本电晕论坛,以及iPhoneDevSDK 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.