For the past couple of years, I have been using OneSignal to send remote notifications. With the notification I send additionalData.audioPath ex: "audio\sound.wav" and I'm able to play the sound from inside of the notification handler.
This continues to work on older versions of Android < 8, but nothing I try allows me to play such sounds in version 8.
I've tried passing in android_sound in lieu of the additionalData field to have the OS play it automatically.
I've tried playing event.sound explicitly
I removed the one signal functionality from my app and replaced it with FCM and notifications V2.
- I've tried it this way using the OneSignal API
- I've tried it this way by pushing a message directly from the Firebase UI.
- I've also tried the OneSignal UI
I've tried different variations of the file name and path "sound", "sound.wav", "audio\sound.wav", etc..
I've created and subscribed to categories and made sure the notification sounds are enabled for my app, category, and Corona by long pressing a notification.
I use the very same audio files in other parts of the application and they continue to play as expected. It seems that the notification handler suppresses all audio.
I can also see that the expected data exists in the notifications by using print commands and adb logcat
Samsung Galaxy Note 8 - SM-N950U
Android version 8.0.0