Permalink
Browse files

*Prints warning when running in the simulator instead of trying to op…

…en the URL

*Fixed bug in appLaunched:. Incorrectly believed that multitasking devices received appWillEnterForeground method call on launch.
  • Loading branch information...
1 parent 776ce19 commit b9382a65e72dadc03f1e8a64fbe661f4bf7d8778 Arash Payan committed Jan 16, 2011
Showing with 4 additions and 11 deletions.
  1. +4 −11 Appirater.m
View
@@ -289,17 +289,6 @@ + (void)appLaunched {
}
+ (void)appLaunched:(BOOL)canPromptForRating {
- /* We only count launches on non-multitasking devices, because
- multitasking devices also get a usage call when they come
- into the foreground and we don't want to count app launches
- as two uses on multitasking devices. */
- UIDevice *device = [UIDevice currentDevice];
- if ([device respondsToSelector:@selector(multitaskingSupported)] &&
- [device multitaskingSupported])
- {
- return;
- }
-
NSNumber *_canPromptForRating = [[NSNumber alloc] initWithBool:canPromptForRating];
[NSThread detachNewThreadSelector:@selector(incrementAndRate:)
toTarget:[Appirater sharedInstance]
@@ -336,6 +325,9 @@ - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)butto
}
case 1:
{
+#if TARGET_IPHONE_SIMULATOR
+ NSLog(@"APPIRATER NOTE: iTunes App Store is not supported on the iOS simulator. Unable to open App Store page.");
+#else
// they want to rate it
NSString *reviewURL = nil;
// figure out which URL to use. iPad only apps have to use a different app store URL
@@ -352,6 +344,7 @@ - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)butto
[userDefaults synchronize];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:reviewURL]];
+#endif
break;
}
case 2:

0 comments on commit b9382a6

Please sign in to comment.