Skip to content

hu2di/react-native-mosquito-sound

Repository files navigation

react-native-mosquito-sound

INSTALL

  1. npm install react-native-sound --save react-native link react-native-sound

RESOURCE

  1. Add file "yoursound.mp3" to Resources folder in iOS XCode project

CODE

  1. import Sound from "react-native-sound";

  2. constructor(props) { super(props); Sound.setCategory("Playback"); mSound = new Sound("yoursound.mp3", Sound.MAIN_BUNDLE); }

  3. _playSound() { mSound.play(success => { if (success) { console.log("Success"); } else { console.log("Failure"); mSound.reset(); } }); }

About

About

Play mosquito sound in React Native (iOS & Android)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published