Set Notification Sound from Assets folder

前端 未结 6 668
北海茫月
北海茫月 2021-02-05 05:46

I am attaching the sound files in the assets folder for play sound in the notification but I am not able to play sound from the assets folder.

I have setting page from w

6条回答
  •  后悔当初
    2021-02-05 06:10

    I was not able to access directly the assets audio file to the Notification. So i follow this steps and so I am able to play audio in the Notification

    1. I copy that files to the data directory.
    2. Still data directory is not accessible to the Notification sound so I create a custom Content Provider to share the audio file in the read more which are now in data folder.
    3. Now at the time of notification creation I had set the Uri of the file to the Notification sound.

    Now using this steps I am able to set custom sound to the Notification.

提交回复
热议问题