Permalink
Browse files

added work arround for wrong URL Scheme used in new App store on iOS 6

  • Loading branch information...
1 parent 3a9bd6c commit b57fa713e8ac294a9c6ccb30d42d77cf3e2e6694 @Gerharbo committed Aug 28, 2012
Showing with 15 additions and 1 deletion.
  1. +15 −1 Appirater.m
View
@@ -47,6 +47,7 @@
NSString *const kAppiraterReminderRequestDate = @"kAppiraterReminderRequestDate";
NSString *templateReviewURL = @"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=APP_ID";
+NSString *templateReviewURLiOS6 = @"itms-apps://itunes.apple.com/LANGUAGE/app/idAPP_ID";
@interface Appirater ()
- (BOOL)connectedToNetwork;
@@ -325,7 +326,20 @@ + (void)rateApp {
NSLog(@"APPIRATER NOTE: iTunes App Store is not supported on the iOS simulator. Unable to open App Store page.");
#else
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
- NSString *reviewURL = [templateReviewURL stringByReplacingOccurrencesOfString:@"APP_ID" withString:[NSString stringWithFormat:@"%d", APPIRATER_APP_ID]];
+
+ // added work arround for wrong URL Scheme & iOS 6
+ NSString *reviewURL;
+ if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 6.0) {
+ reviewURL = [templateReviewURLiOS6 stringByReplacingOccurrencesOfString:@"APP_ID" withString:[NSString stringWithFormat:@"%d", APPIRATER_APP_ID]];
+
+ reviewURL = [reviewURL stringByReplacingOccurrencesOfString:@"LANGUAGE" withString:[NSString stringWithFormat:@"%@", [[NSLocale preferredLanguages] objectAtIndex:0]]];
+
+ } else {
+ reviewURL = [templateReviewURL stringByReplacingOccurrencesOfString:@"APP_ID" withString:[NSString stringWithFormat:@"%d", APPIRATER_APP_ID]];
+ }
+
+ [[NSLocale preferredLanguages] objectAtIndex:0]
+
[userDefaults setBool:YES forKey:kAppiraterRatedCurrentVersion];
[userDefaults synchronize];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:reviewURL]];

0 comments on commit b57fa71

Please sign in to comment.