Skip to content
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

Use device ringtone for incoming call sound #1179

Merged
merged 20 commits into from
Sep 24, 2024

Conversation

liviu-timar
Copy link
Member

@liviu-timar liviu-timar commented Sep 16, 2024

🎯 Goal

Refactor sound configuration. Add possibility to use device ringtone for incoming call sound.

🛠 Implementation details

  • Added SoundConfig interface to be used in Sounds constructor.
  • Deprecated current Sounds constructor.
  • Added several static factory methods in SoundConfig: createDeviceRingtoneSoundConfig, createStreamResourcesSoundConfig, createEmptySoundConfig.
  • Added a factory method for custom configs, createCustomSoundConfig.
    • Allows user to specify custom sounds for incoming and outgoing calls. The sounds can be either resource IDs or URIs.
  • Using the device ringtone as default.
  • Moved Sounds section from UI Cookbook/Incoming & Outgoing to Advanced/Ringing and updated it. Kept link in the original page. See here.

🧪 Testing

Cases:

  • Default Sounds in Builder: outgoing - default tone provided by SDK, incoming - device ringtone.
  • Use deprecated Sounds constructor: marked as deprecated & using passed sounds.
  • Pass custom sound res to Sounds property: the custom sound will be used.
  • Pass null to Sounds property: that sound will be disabled (muted).
  • Device ringtone evaluates to null: fallback to default SDK incoming sound.
  • Device uses external storage ringtone and app doesn't have READ_EXTERNAL_STORAGE permission: RingtoneManager.getActualDefaultRingtoneUri() will evaluate to null, fallback as above.

🎉 GIF

@liviu-timar liviu-timar force-pushed the PBE-5920-use-device-ringtone branch 4 times, most recently from a543571 to 1f0b12a Compare September 16, 2024 13:20
@liviu-timar liviu-timar marked this pull request as ready for review September 16, 2024 13:20
@liviu-timar liviu-timar requested a review from a team as a code owner September 16, 2024 13:20
@liviu-timar liviu-timar force-pushed the PBE-5920-use-device-ringtone branch from 1f0b12a to 5d8ef1e Compare September 16, 2024 13:23
@liviu-timar liviu-timar force-pushed the PBE-5920-use-device-ringtone branch 7 times, most recently from 5059361 to 04e08ff Compare September 18, 2024 10:23
@liviu-timar liviu-timar force-pushed the PBE-5920-use-device-ringtone branch from 04e08ff to 9e0ed94 Compare September 18, 2024 10:23
@aleksandar-apostolov aleksandar-apostolov merged commit 7f45223 into develop Sep 24, 2024
7 checks passed
@aleksandar-apostolov aleksandar-apostolov deleted the PBE-5920-use-device-ringtone branch September 24, 2024 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants