project_files/HedgewarsMobile/Classes/Appirater.m
changeset 6246 6b2d19ed521a
parent 6078 8c0cc07731e5
child 6832 fae8fd118da9
equal deleted inserted replaced
6245:6df227b5e4c9 6246:6b2d19ed521a
    35  */
    35  */
    36 
    36 
    37 #import "Appirater.h"
    37 #import "Appirater.h"
    38 #import <SystemConfiguration/SCNetworkReachability.h>
    38 #import <SystemConfiguration/SCNetworkReachability.h>
    39 #import <netinet/in.h>
    39 #import <netinet/in.h>
    40 #import "ServerSetup.h"
       
    41 
    40 
    42 NSString *const kAppiraterLaunchDate            = @"kAppiraterLaunchDate";
    41 NSString *const kAppiraterLaunchDate            = @"kAppiraterLaunchDate";
    43 NSString *const kAppiraterLaunchCount           = @"kAppiraterLaunchCount";
    42 NSString *const kAppiraterLaunchCount           = @"kAppiraterLaunchCount";
    44 NSString *const kAppiraterCurrentVersion        = @"kAppiraterCurrentVersion";
    43 NSString *const kAppiraterCurrentVersion        = @"kAppiraterCurrentVersion";
    45 NSString *const kAppiraterRatedCurrentVersion   = @"kAppiraterRatedCurrentVersion";
    44 NSString *const kAppiraterRatedCurrentVersion   = @"kAppiraterRatedCurrentVersion";
   104 
   103 
   105         if (secondsSinceLaunch > secondsUntilPrompt &&
   104         if (secondsSinceLaunch > secondsUntilPrompt &&
   106              launchCount > LAUNCHES_UNTIL_PROMPT &&
   105              launchCount > LAUNCHES_UNTIL_PROMPT &&
   107              !declinedToRate &&
   106              !declinedToRate &&
   108              !ratedApp) {
   107              !ratedApp) {
   109             if ([ServerSetup isNetworkReachable]) {	// check if they can reach the app store
   108             if ([HWUtils isNetworkReachable]) {	// check if they can reach the app store
   110                 willShowPrompt = YES;
   109                 willShowPrompt = YES;
   111                 [self performSelectorOnMainThread:@selector(showPrompt) withObject:nil waitUntilDone:NO];
   110                 [self performSelectorOnMainThread:@selector(showPrompt) withObject:nil waitUntilDone:NO];
   112             }
   111             }
   113         }
   112         }
   114     } else {
   113     } else {