How can I limit the length of the recording (e.g. no recordings longer than 60s)?

Please provide the following:

  1. SDK Version: 40.0.0
  2. Platforms(Android/iOS/web/all): IOS/Android
  3. Add the appropriate “Tag” based on what Expo library you have a question on : expo-av

Hi looking to find a way to stop a recording once a certain time limit is reached. I’m using the recording.setOnRecordingStatusUpdate(onRecordingStatusUpdate) api to get the info on the current time. Once i get the time i store this in a state variable. I tried using useEffect to call my stopRecording function if the time limit is reached and while that works, the setOnRecordingStatusUpdate method does not safely end. Is there something wrong in my process?