Disable the screen Lock when audio recording iOS
Solution:
If you are recording the audio when your app is on use and don't had any actions performed only recording will happen then if your screen lock time is some seconds that time screen will be locked.
So try the below code code to disable the screen lock when audio is recording.When audio record started the call the below code.
Objective C:
[UIApplication sharedApplication].idleTimerDisabled = YES;
Swift:
Objective C:
[UIApplication sharedApplication].idleTimerDisabled = No;
Swift:
If you are recording the audio when your app is on use and don't had any actions performed only recording will happen then if your screen lock time is some seconds that time screen will be locked.
So try the below code code to disable the screen lock when audio is recording.When audio record started the call the below code.
Objective C:
[UIApplication sharedApplication].idleTimerDisabled = YES;
Swift:
UIApplication.shared.isIdleTimerDisabled = true
In didfinishrecording call the below code
[UIApplication sharedApplication].idleTimerDisabled = No;
Swift:
UIApplication.shared.isIdleTimerDisabled = false
Comments
Post a Comment