Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No sound received when App is in background/kill mode #157

Open
Chahatchugh opened this issue Dec 12, 2022 · 1 comment
Open

No sound received when App is in background/kill mode #157

Chahatchugh opened this issue Dec 12, 2022 · 1 comment

Comments

@Chahatchugh
Copy link

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 .

@midhuntechversant
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants