IOS红外感应和防止待机



ios设备的红外感应,打电话的时候会自动黑屏的那个API:

 [[UIDevice currentDevice] setProximityMonitoringEnabled:YES];

 通知:   [[NSNotificationCenter defaultCenter] addObserver:self selector:nil name:UIDeviceProximityStateDidChangeNotification object:nil];



设置屏幕不进入待机状态:

    [[UIApplication sharedApplication] setIdleTimerDisabled:YES];






你可能感兴趣的:(IOS红外感应和防止待机)