A module to play system sounds and beeps for React Native on iOS and Android (no sound files).
Heavily inspired by react-native-a-beep
Built with the Expo Modules API
- Install package from npm
yarn add @dashdoc/react-native-system-soundsMake sure Expo Modules are installed in your app. Expo apps already include them. In a bare React Native app, follow Expo's installing Expo modules guide.
Install iOS Pods
cd ios && pod install &&cd ..importRNSystemSoundsfrom'@dashdoc/react-native-system-sounds';// ...<Buttontitle="Play positive beep"onPress={()=>RNSystemSounds.beep()}/><Buttontitle="Play negative beep"onPress={()=>RNSystemSounds.beep(RNSystemSounds.Beeps.Negative)}/><Buttontitle="Play custom system sound"onPress={()=>RNSystemSounds.play(Platform.select({android: RNSystemSounds.AndroidSoundIDs.TONE_CDMA_ABBR_ALERT,ios: RNSystemSounds.iOSSoundIDs.AudioToneBusy,}))}/>- Clone the repository, enter the
exampledirectory and install dependencies.
git clone git@github.com:dashdoc/react-native-system-sounds.git
cd example/
yarn install- Install iOS Pods,
cd ios && pod install &&cd ..- Start bundler.
yarn start- On a new terminal, run the app on the
<platform>of your choice (iosorandroid).
cd example/
yarn <platform>