2015-07-06 2 views

ответ

0

Перейти через этот блог, это поможет вам

How to Detect When an App Is Coming From the Lockscreen or Homescreen on iOS

- (void)applicationDidEnterBackground:(UIApplication *)application { 
    CGFloat screenBrightness = [[UIScreen mainScreen] brightness]; 
    NSLog(@"Screen brightness: %f", screenBrightness); 
    self.backgroundedToLockScreen = screenBrightness <= 0.0; 
} 



- (void)applicationWillEnterForeground:(UIApplication *)application { 
    if (self.backgroundedToLockScreen) { 
     ... // App was backgrounded to lock screen 
    } else { 
     ... // App was backgrounded on purpose by tapping the home button or switching Apps. 
    } 
    self.backgroundedToLockScreen = NO; 
} 
1

Попробуйте отключить фоновый режим для аудио и Airplay

- (void)applicationDidEnterBackground:(UIApplication *)application { 
    // pause the video here 
} 

- (void)applicationWillEnterForeground:(UIApplication *)application  { 
    // resume video when screen unlock 
}