Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit b57fa713e8ac294a9c6ccb30d42d77cf3e2e6694 1 parent 3a9bd6c
Gerhard Bos Gerharbo authored
Showing with 15 additions and 1 deletion.
  1. +15 −1 Appirater.m
16 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]];
Please sign in to comment.
Something went wrong with that request. Please try again.