Android, unity, onesignal - where to place the sound file?

Saying I'm new to Android development would be an understatement. I'm trying to figure out where to place the sound file in my unity directory, so that oneignal, a third-party notification server, can access it for this particular api method:

android_sound: StringOptional A sound file that is included in your application for playback, instead of the default device notification sound. NOTE. Leave the extension for Android. Example: "notice"

link: https://documentation.onesignal.com/reference#create-notification

I get a build error when I put it in res / raw and in another place in google services library enter image description here

Where is he going?

+1
source share
2 answers

You will need to place the OneSignalNotificationRes folder from our Unity example project in your Assets/Plugins/Android/ folder. Replace the sample icons and sound files with your own.

For more information, see bottom 3. Android in our Unity setup guide.

Thanks.

+3
source

In Android,

Just move the .mp3 file to

res / raw folder

So your .mp3 file should display as src / raw / onesignal_default_sound.mp3

Then create your code and send push.

You can also use other file names, but you must add the name of the sound file when sending push enter image here

Enjoy it ^^

0
source

All Articles