if ([[[UIDevice currentDevice] systemVersion] floatValue] < 7.0) {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(noApplePush) name:@"UIMoviePlayerControllerDidEnterFullscreenNotification" object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveApplePush) name:@"UIMoviePlayerControllerDidExitFullscreenNotification" object:nil];
}else if ([[[UIDevice currentDevice] systemVersion] floatValue] < 8.0){
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(noApplePush) name:@"UIWindowDidBecomeHiddenNotification" object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveApplePush) name:@"UIWindowDidBecomeVisibleNotification" object:nil];
}else{
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveApplePush) name:@"UIWindowDidBecomeHiddenNotification" object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(noApplePush) name:@"UIWindowDidBecomeVisibleNotification" object:nil];
}
-(void)noApplePush{
NSLog(@"------进入--------");
// GNAppDelegate.shouldNotAlert = YES;
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"shouldNotAlert"];
}
-(void)receiveApplePush{
NSLog(@"------退出--------");
// GNAppDelegate.shouldNotAlert = NO;
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"shouldNotAlert"];
}