Play Webrtc Audio message when IOS app is in background
I am trying to develop an app like "zello" push to talk using react-native. I want to play the audio message automatically without any user interaction when the ios app is in background or killed. Whenever any user sending real time audio message, I am sending a push notification to ios app and after receiving notification I am invoking a function which establishes socket connection with the webrtc server and then join in the room in which webrtc audio broadcasting is happening. Now I checked that socket is connected and also joining in room successfully done after receiving push notification when app is in background. But there I could not hear any audio and received following error message.
AURemoteIO.cpp:1668 AUIOClient_StartIO failed (561145187)
Then I have set AVAudioSessionCategoryPlayback and that error gone. But this time, I did not hear any audio sound though there is no error. The app is working fine when it is in foreground. I am using react-native and this is happening for IOS app only. Any help is appreciated. In xcode I have enabled push-notifications, background-fetch, background-airplay etc.
On the other hand, instead of webrtc audio, I just wanted to play a mp3 uri but that also not playing. I am working with iphone 13 and xcode 13. Later I upgrade xcode to 14 but still no luck. I can not see any "Push to Talk" option in background mode.
Please help me in this regard.Please choose a Topic.
Note: User are not required to press on notification and open the app. The audio should be played user any user interaction when app is in background.