react-native-sound-player icon indicating copy to clipboard operation
react-native-sound-player copied to clipboard

No sound received when App is in background/kill mode

Open Chahatchugh opened this issue 3 years ago • 2 comments

PLATFORM AND VERSION iOS iPhone 12 mini Version: iOS 16.1.2 Xcode Version : 14.1 react-native: "^0.64.3" react-native-sound-player: "^0.13.2"

DESCRIPTION OF PROBLEM As per configuration , I am unable to get customise as well as by default notification sound . I have already included these steps as shown below : -----------------> SET UP CUSTOM SOUND ON IOS Go to your_project_root/ios and place the sound in there. This doesn’t yet add it to the project, it just places the sound in a logical spot. Open up Xcode and go to the project navigator tab. Drag your sound into your project. Select “copy files if needed” on the dialog. That’s it! <------------------

Also, From Backend we have sent sound in this format : --------------> "notification": { "title": "Some title", "body": "Some body", "sound": "my_custom_sound.wav", "android_channel_id": "new_email_arrived_channel" },<-----------------

Lastly , react-native-sound-player docs has also mentioned : ----------------> Please note that the device can still go to sleep (screen goes off) while audio is playing. When this happens, the audio will stop playing. To prevent this, you can use something like react-native-keep-awake. Or alternatively, for iOS, you can add a Background Mode of Audio, AirPlay, and Picture in Picture in XCode. To do this, select your application from Targets, then click on Signing & Capabilities and add Background Modes. once the options for it appear on your Signing & Capabilities page select the checkbox with Audio, AirPlay, and Picture in Picture. This will allow the application to continue playing audio when the app is in the background and even when the device is locked. <----------------- This is also done from my end .

Is there anything else we are missing for notification sound [APP IN BACKGROUND/KILL MODE]. Foreground customised sound is coming . Please help us to resolve .

STEPS TO REPRODUCE App in background/kill mode , Notification sound not received in IOS .

Chahatchugh avatar Dec 12 '22 05:12 Chahatchugh

Hi @johnsonsu is it possible to achieve this functionality in Android and IOS?

midhuntechversant avatar Jun 21 '24 11:06 midhuntechversant

I am using RN 0.77 with new architecture , please fix this in new architecture. Thanks.

diptimaya-seneca avatar Feb 22 '25 00:02 diptimaya-seneca