I'm using AVAudioRecorder to record audio on my Swift app. It takes 30 seconds clip, do some things with that clip, deletes the clip and then it starts the recording of 30 seconds on a new clip, and it goes on. The app works fine doing that on the background, I have the audio background mode enabled. The problem that I'm having is that, when it passes some time (probably like 90 minutes or something like that), the recording suddenly stops and it does not continue recording. I handle the interruptions in my app fine, so when the recording stops for some reason, I get a notification telling me that the recording has been stopped; but when it passes about 90 minutes, the recording just stops without giving me any alerts or something.
In fact, I enable the recording with an UISwitch. If the recording stops normally due to some interruption, the switch changes to 'off'. But when the recording stops when about 90 minutes has passed, the switch does not change and it is like the app doesn't get notified about the recording session being canceled.
I do not know if this is due to some time restriction when I use a recording on the background or something like that. I could't find any documentation about this problem, so that's why I'm asking for help here.