Monaca Onsen UI Discord Chat Github Repo

OneSignal Custom Sound



  • Re: Add resource file to monaca project?

    I’m doing the above but it is not working.

    <platform name=“android”>
    <resource dest=“res/raw/alarm.wav” src=“www/sounds/alarm.wav” />

    The app builds but when I extract the apk the alarm.wav is not under /res/raw/



  • I finally figured this out after probably 5+ hours combined of trying. For the next person in the same boat, here’s the solution for both iOS and Android. I hope this helps someone and saves them from the torment I went through trying to figure this out on my own. The audio file in the example below (alarm.wav) is placed in the root of the www folder. You can adjust that as desired.

    <platform name=“android”>
    <resource-file src=“www/alarm.wav” target=“res/raw/alarm.wav” />

    </platform>

    <platform name=“ios”>
    <resource-file src=“www/alarm.wav” target=“res/ios/alarm.wav” />

    </platform>