johnsonsu/react-native-sound-player

No sound received when App is in background/kill mode

Opened this issue · 1 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 .

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