There seems to be an issue worth mentioning in iOS 7.0 as described here. You can see how Appirator dealt with the problem in their source here.
Basically, you need to handle 7.0 users differently, as so: (the first line is the same as the accepted solution, the appended strings are just on the same line.)
NSString *str = @"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=yourAppIDHere";
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) {
str = @"itms-apps://itunes.apple.com/app/idyourAppIDHere";
}
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
Update 19 August 2015
The URLs above don't work for iOS 8.0. Updated code catering for all iOS versions would be:
NSString *str;
float ver = [[[UIDevice currentDevice] systemVersion] floatValue];
if (ver >= 7.0 && ver < 7.1) {
str = [NSString stringWithFormat:@"itms-apps://itunes.apple.com/app/id%@",appID];
} else if (ver >= 8.0) {
str = [NSString stringWithFormat:@"itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=%@&onlyLatestVersion=true&pageNumber=0&sortOrdering=1&type=Purple+Software",appID];
} else {
str = [NSString stringWithFormat:@"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%@",appID];
}
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
Source: Appirator
Update 14 November 2017
From iOS 10.3, we can request a review using the SKStoreReviewController, which actually opens a neat little popover in your app rather than navigating away from your app:
if (@available(iOS 10.3, *)) {
[SKStoreReviewController requestReview];
return;
}