Closed anshul-kai closed 7 years ago
I found that github references version 8.4 of the plugin ( which includes enableInSilenceMode and setCategory ), whereas the version on npm (8.3) does not yet have this functionality.
To get around, I just cloned this git repo into my node_modules, instead of npm install. There is probably a cleaner way to do that, but that's what is working for me.
Thanks @andrew-tam-000! I feel like an idiot to have not noticed that.
To use npm i
, just replace your package.json
with the following. It is the same as cloning master
.
Package.json
"react-native-sound": "github:zmxv/react-native-sound"
FWIW, enableInSilenceMode
is still not working for me but using setCategory('Playback')
works and does the same thing.
I'll leave this open for the devs to address npm issues.
No problem @a-koka! It also took me forever to figure it out... so just spreading the love XD.
And awesome, I've wondered how to do that git cloning via npm for the longest time, thanks!
I've made it clearer in the docs that enableInSilenceMode is deprecated and setCategory is the way to go now.
enableInSilenceMode
andsetCategory
are no longer available. After looking at details here and reading up other posts, I'm still having trouble making sounds work when iPhone is in silent mode.The code below returns successfully but sound doesn't play in silent mode.
Any suggestions?