Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merged in mrcmd-master

  • Loading branch information...
commit 551ae713cede214ec0c3fdfed27b51124f77e178 2 parents d6922db + 946469a
@ngreenstein ngreenstein authored
Showing with 19 additions and 1 deletion.
  1. +19 −1 Appirater.m
View
20 Appirater.m
@@ -38,6 +38,10 @@
#import <SystemConfiguration/SCNetworkReachability.h>
#include <netinet/in.h>
+#if ! __has_feature(objc_arc)
+#warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC).
+#endif
+
NSString *const kAppiraterFirstUseDate = @"kAppiraterFirstUseDate";
NSString *const kAppiraterUseCount = @"kAppiraterUseCount";
NSString *const kAppiraterSignificantEventCount = @"kAppiraterSignificantEventCount";
@@ -372,6 +376,20 @@ + (void)userDidSignificantEvent:(BOOL)canPromptForRating {
});
}
++ (id)getRootViewController {
+ UIWindow *window = [[UIApplication sharedApplication] keyWindow];
+ if (window.windowLevel != UIWindowLevelNormal) {
+ NSArray *windows = [[UIApplication sharedApplication] windows];
+ for(window in windows) {
+ if (window.windowLevel == UIWindowLevelNormal) {
+ break;
+ }
+ }
+ }
+
+ return [[[window subviews] objectAtIndex:0] nextResponder];
+}
+
+ (void)rateApp {
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
@@ -388,7 +406,7 @@ + (void)rateApp {
if ([self.sharedInstance.delegate respondsToSelector:@selector(appiraterWillPresentModalView:animated:)]) {
[self.sharedInstance.delegate appiraterWillPresentModalView:self.sharedInstance animated:_usesAnimation];
}
- [[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:storeViewController animated:_usesAnimation completion:^{
+ [[self getRootViewController] presentViewController:storeViewController animated:_usesAnimation completion:^{
[self setModalOpen:YES];
//Temporarily use a black status bar to match the StoreKit view.
[self setStatusBarStyle:[UIApplication sharedApplication].statusBarStyle];
Please sign in to comment.
Something went wrong with that request. Please try again.