I want my application to play notification sound through URL
. My custom sound file lies at a particular working URL
. So, I want my app to use that link to notify user about notification.
I've tried AVPlayer
,since it plays sound files through URL's Check this
The AVPlayer
code is working when I call it using [self playselectedsong]
(plz check code provided in above link) in didFinishLaunchingWithOptions
of AppDelegate
and viewDidLoad
function of other views.
Whenever the notification arrives(didReceiveRemoteNotification
) with an audio file URL
,which then I add into the AVPlayer
,the sound isn't playing.Only the text notification is shown.
I hope it may help you.
The sound must come from a file in the app bundle.
See Apple Reference here