If I put device into silent mode using switch, AudioServicesAddSystemSoundCompletion
callback method doesn't get called. If the switch is on, I mean if device is NOT in silent mode, method gets called perfectly.
Has anyone experienced something like this. Is this a bug?
I had the same problem. It is not a bug. If the sound is not played, due to the device being muted the call back never gets called.
A work around is to use an NSTimer that is the same length as the sound to be played. If the sound doesn't play the timer call back gets called. Which can perform the same code as your callback.
The source code for Sound Switch (with demo project) indicates that the callback does in fact occur also if the device is in silent mode.
I've just tried this with iOS 8.1 on an iPhone 5 and silent mode turned off/on with the button on the device.
Here is how you can use the NSTimer for soundDidFinishPlaying callback even in Silent Mode.