zmxv / react-native-sound

React Native module for playing sound clips
MIT License
2.78k stars 748 forks source link

Playing music with the app in the background in production does not work #722

Open SNWStaff opened 3 years ago

SNWStaff commented 3 years ago

:beetle: Description

Hello, I am currently developing an application that allows me to play music when I receive a voip push notification. I explain, when I receive the notification, the application opens in background and plays the music. In debug I have absolutely no problem, but since I put the application in production I can't play the music anymore. The application is in production thanks to the app distribution of firebase and app Tester for the moment.

:beetle: What have you tried?

I'm currently trying to code / cut out the options in Xcode related to the audio and background modes. I tried to change the playback modes ( Ambient and Playback )

Is your issue with...

Are you using...

Which versions are you using?

Does the problem occur on...

If your problem is happening on a device, which device?

benorgan commented 3 years ago

I'm also seeing this issue, works fine in the simulator but not in release apps. It seems to happen intermittently for me though, seemingly at random.

maullerz commented 2 years ago

as it was said in https://github.com/zmxv/react-native-sound/issues/690

try adding Sound.setCategory('Playback');

it helped me with "no sound" issue

benorgan commented 2 years ago

That did help, I also had to do sound.setCurrentTime(0) before playing the sound.