How can i activate alarm/Audio when app is in background or inactive mode in ios?

On alarm time, the alarm will get from the server and will be played but the alarm ringtone length is up to 2 mint. How can we achieve this? I used silent push notification and try to get toune from the server and play in AVAudioPlayer, it works when the app is in foreground mode but in background mode, it gives an error in getting ringtone Error "Software caused connection abort" What should be the best solution to achieve this?