Here is what I am trying to do play a short short sound (tone) when an event is triggered and the app is in the background. This needs to work even when the ringer is off (as the user will be using this feature to find their phone). So the AVAudioPlayer with category playback seems like my only viable option, and it was working fine until recently I encountered the following issue:
When the app is in the background, and I call the setActive method on the instance of the AVAudioSession, I get the following error (in the NSError passed to the aforementioned method):
NSOSStatusErrorDomain code=561015905, the description is null
The app has audio background permission in the Info plist, and the same code used to work fine a week ago. Now I get the error on simulator as well as actual hardware device. Can you please help me understand what exactly is the problem, and/or any other mechanism of achieving my objective stated above.