After doing various trial and error for more than 5 days, I finally realized that my problem was with the phone turned off. When it is muted, sound is not played! So, I added the following line of code to indicate my category as playback, and now it plays even when my device switch is off
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
Thanks!
source share