Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Unable to play audio file inside of a notification handler : Android Oreo
Started by balloonknot Feb 20 2019 08:42 AM

2 replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

balloonknot

[GLOBAL: userInfoPane.html]
balloonknot
  • Contributor

  • 100 posts
  • Corona SDK

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

 

Corona 2019.3463

Samsung Galaxy Note 8 - SM-N950U

Android version 8.0.0

 

 

 

 



[TOPIC: post.html]
#2

balloonknot

[GLOBAL: userInfoPane.html]
balloonknot
  • Contributor

  • 100 posts
  • Corona SDK

Bump. Anyone?



[TOPIC: post.html]
#3

agramonte

[GLOBAL: userInfoPane.html]
agramonte
  • Corona Geek

  • 1,009 posts
  • Corona SDK

Have you tried checking if the file exists? I had a similar issue that I have not been able to resolve. Outside of the handle can you reach the file?




[topic_controls]
[/topic_controls]