0

I have OneSignal implemented into our app and things are running smoothly. The only thing I can't get working is triggering the push notification with the sound I send with it.

In my res/raw folder I have a sound file called okayy.mp3 (OneSignal approved format).

In one signal I include the file name as "okayy" but it just plays the default sound. I have even tried setting the default OneSignal sound as their docs recommended "onesignal_default_sound.mp3) and even that is not used.

Any ideas?

3 Answers 3

4

Create a file keep.xml in res/xml folder and put this code in the file :

<resources
    xmlns:tools="http://schemas.android.com/tools"  
    tools:keep="@raw/okayy"/>
Sign up to request clarification or add additional context in comments.

Comments

0

You must Setting up Notification Categories https://documentation.onesignal.com/docs/android-notification-categories#section-setting-up-notification-categories

And choose "sound" category parameter to "okayy"

Comments

-1

The answer from @sanuj is correct, but I guess you have to include the file extension, like this:

<resources
    xmlns:tools="http://schemas.android.com/tools"  
    tools:keep="@raw/okayy.mp3"/>

1 Comment

No, you don't have to include it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.