New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@dashdoc/react-native-system-sounds

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dashdoc/react-native-system-sounds

A module to play system sounds and beeps for React Native on iOS and Android (no sound files).

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.8K
increased by16.54%
Maintainers
2
Weekly downloads
 
Created
Source

@dashdoc/react-native-system-sounds

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 react-native-module-init

Installation

Mostly automatic install with autolinking (RN > 0.60)

  1. Install package from npm
yarn add @dashdoc/react-native-system-sounds
  1. Install iOS Pods
cd ios && pod install && cd ..
  1. Install package from npm
yarn add @dashdoc/react-native-system-sounds
  1. Link package with react-native link
yarn react-native link @dashdoc/react-native-system-sounds
  1. Install iOS Pods
cd ios && pod install && cd ..

Usage

import RNSystemSounds from '@dashdoc/react-native-system-sounds';

// ...

<Button
  title="Play positive beep"
  onPress={() => RNSystemSounds.beep()}
/>

<Button
  title="Play negative beep"
  onPress={() => RNSystemSounds.beep(RNSystemSounds.Beeps.Negative)}
/>

<Button
  title="Play custom system sound"
  onPress={() =>
    RNSystemSounds.play(
      Platform.select({
        android: RNSystemSounds.AndroidSoundIDs.TONE_CDMA_ABBR_ALERT,
        ios: RNSystemSounds.iOSSoundIDs.AudioToneBusy,
      })
    )
  }
/>

Example

  1. Clone the repository, enter the example directory and install dependencies.
git clone git@github.com:dashdoc/react-native-system-sounds.git
cd example/
yarn install
  1. Install iOS Pods,
cd ios && pod install && cd ..
  1. Start bundler.
yarn start
  1. On a new terminal, run the app on the <platform> of your choice (ios or android).
cd example/
yarn <platform>

Caveats

This does not work on iOS simulator.

License

MIT

Keywords

FAQs

Package last updated on 24 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc