Skip to content

fix: How to stop recorder when app is killed (#521) #654

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

hongdtt-ominext
Copy link
Contributor

No description provided.

@hyochan hyochan requested a review from Copilot June 13, 2025 16:04
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes an issue where recording does not properly stop when the app is terminated by introducing auto-save functionality for active recordings on app termination.

  • Added a termination notification observer and corresponding cleanup logic in iOS.
  • Implemented LifecycleEventListener in Android to stop and release the media recorder during host destruction.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
ios/RNAudioRecorderPlayer.swift Adds observer for app termination and auto-save functionality when the app is killed.
android/src/main/java/com/dooboolab.audiorecorderplayer/RNAudioRecorderPlayerModule.kt Implements LifecycleEventListener to auto-save recording on host destruction and attempts to remove the event listener using finalize.
Comments suppressed due to low confidence (1)

android/src/main/java/com/dooboolab/audiorecorderplayer/RNAudioRecorderPlayerModule.kt:441

  • Using finalize for cleanup may lead to unreliable behavior; consider explicitly removing the lifecycle event listener in a dedicated cleanup method (such as onCatalystInstanceDestroy) to ensure timely resource release.
protected fun finalize() {

@hyochan hyochan added 🍗 enhancement New feature or request 📱 iOS Related to iOS labels Jun 13, 2025
Copy link
Owner

@hyochan hyochan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@hyochan hyochan merged commit 8d4f2b3 into hyochan:main Jun 25, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍗 enhancement New feature or request 📱 iOS Related to iOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants