In Expo React Native, how can I open the list of notification sounds on Android? I know…
- User
In Expo React Native, how can I open the list of notification sounds on Android? I know an app built with React that has a button which opens the full list of Android notification sounds so you can choose one for a specific feature. How can I do the same?
- Assistant
In Expo React Native, there is no built-in API that directly opens the native Android notification sound picker UI. However, you can achieve this by using a custom native module or by ejecting to the bare workflow and using a native Android Intent to open the system sound picker.
Why?
Android provides a system UI to pick notification sounds via an Intent with action
RingtoneManager.ACTION_RINGTONE_PICKER. This is not exposed by Expo's managed workflow out of the box.
How to open the Android notification sound picker
1. Using Bare Workflow (or custom dev client)
If you eject to the bare workflow or use a custom dev client, you can write a native module that launches the ringtone picker:
// In your MainActivity.java or a custom module import android.app.Activity; import android.content.Intent; import android.media.RingtoneManager; import android.net.Uri; public void openNotificationSoundPicker() { Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER); intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, RingtoneManager.TYPE_NOTIFICATION); intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TITLE, "Select Notification Sound"); intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_SILENT, false); intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_DEFAULT, true); // Optionally, set the currently selected sound URI Uri currentSoundUri = RingtoneManager.getActualDefaultRingtoneUri(this, RingtoneManager.TYPE_NOTIFICATION); intent.putExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI, currentSoundUri); startActivityForResult(intent, REQUEST_CODE_PICK_SOUND); }You then handle the result in
onActivityResultto get the selected sound URI.
2. Using React Native community packages
There is no widely used React Native package that exposes this picker directly, but you can create a native module yourself or use a package like:
react-native-sound-picker(if available)- Or write your own native module as above.
3. Using Expo Managed Workflow (workaround)
In Expo Managed workflow, you cannot run native code directly. But you can:
- Use
IntentLauncherAndroidfromexpo-intent-launcherto launch some system settings screens, but unfortunately, it does not support launching the ringtone picker directly. - Alternatively, open the system sound settings screen where users can change notification sounds globally:
import * as IntentLauncher from 'expo-intent-launcher'; IntentLauncher.startActivityAsync(IntentLauncher.ACTION_SOUND_SETTINGS);This opens the sound settings but not the picker UI.
Summary
Approach Can open notification sound picker? Notes Expo Managed workflow No Only system settings screen possible Expo Bare workflow Yes Write native module with RingtoneManager.ACTION_RINGTONE_PICKERintentReact Native bare project Yes Same as above
Example native module for bare workflow
If you want, I can help you write a full example of a native module and React Native bridge to open the picker and get the result.
If you want to proceed with bare workflow or eject, let me know! Otherwise, the closest you can do in Expo Managed is opening the sound settings screen.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.