Skip to content

iOS: destroyProvider method has added - #587

Closed
yunusaydinonline wants to merge 6 commits into
react-native-webrtc:masterfrom
yunusaydinonline:added_ios_destroyProvider_method
Closed

yunusaydinonline wants to merge 6 commits into
react-native-webrtc:masterfrom
yunusaydinonline:added_ios_destroyProvider_method

Conversation

@yunusaydinonline

Copy link
Copy Markdown
Contributor

Hi,

This PR contains destroying provider manually in order to be able to call setup() method again to activate ringtoneSound changes.
When user picks the new ringtone over UI, the app shouldn't be killed and reopen. In fact, it should change the ringtone sound immediately. So, I added this small helper in order to achieve this functionality.

@sboily
sboily requested a review from manuquentin November 21, 2022 16:28
@sboily sboily added ios need review Need to review ticket labels Nov 21, 2022
[audioSession setCategory:AVAudioSessionCategoryPlayAndRecord withOptions:AVAudioSessionCategoryOptionAllowBluetooth error:nil];

[audioSession setMode:AVAudioSessionModeDefault error:nil];
[audioSession setMode:AVAudioSessionModeVoiceChat error:nil];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why changing this ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@sboily

sboily commented Oct 17, 2026

Copy link
Copy Markdown
Member

Thanks, and sorry for the long wait. Closing: #732 covers the same need (applying new provider options such as the ringtone without restarting) by updating the provider's configuration in place; here self.callKeepProvider would still point to the invalidated provider. The audio session mode has since become configurable through audioSession.mode in setup(), and removing configureAudioSession from didActivateAudioSession would change audio behaviour for every app.

@sboily sboily closed this Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ios need review Need to review ticket

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants