Solved Custom sound via API not working

Discussion in 'Join' started by kranix, Jul 5, 2020.

  1. kranix

    kranix New Member

    Joined:
    Jul 5, 2020
    Messages:
    6
    Likes Received:
    0
    I've got a custom text notification via API working. Now I'm trying to specify a custom notification sound but I'm only hearing the default sound.

    Here's a sample URL (API key redacted):
    https://joinjoaomgcd.appspot.com/_ah/api/messaging/v1/sendPush?apikey={API_Key}&deviceId=group.all&title=Test%20Title&text=This%20is%20a%20message&sound=http%3A%2F%2Fwww.fesliyanstudios.com%2Fplay-mp3%2F4429​
     
  2. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Try setting a category for the notification as well. Otherwise it'll always use the sound set for the default category. Unfortunately recent Android changes made it so that a notification has to have a different category to use a different sound.
     
  3. kranix

    kranix New Member

    Joined:
    Jul 5, 2020
    Messages:
    6
    Likes Received:
    0
  4. kranix

    kranix New Member

    Joined:
    Jul 5, 2020
    Messages:
    6
    Likes Received:
    0
    Testing further, I observe that my phone doesn't make a notification sound if a category is set. If I remove the category, at least I get the default notification sound.

    A spoken message works. I'm currently using that as a workaround.

    I've got a Google Pixel 2 with Android 10.
     
  5. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    What if you go into Android Settings > Apps > Join > Notifications > cat > modify sound there?
     
  6. kranix

    kranix New Member

    Joined:
    Jul 5, 2020
    Messages:
    6
    Likes Received:
    0
    Here's what a new category looks like after using a Join API URI:
    https://imgur.com/a/DLIfOGA

    I can manually change the notification sound from there and it works for subsequent notifications in that category. But the sound URI pushed via the API does not work.
     
  7. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Yep, that's just how Android works unfortunately :( Google changed it so that only the user can change a category's sound. The app can't do that itself.
     
  8. kranix

    kranix New Member

    Joined:
    Jul 5, 2020
    Messages:
    6
    Likes Received:
    0
    Thanks for explaining. Would that mean that the "sound" URL parameter is redundant? It's essentially non-functional.
     
  9. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    It should work for the first time you create the notification category (by creating a notification with that category for the first time), but won't be able to be changed after that.
     
  10. kranix

    kranix New Member

    Joined:
    Jul 5, 2020
    Messages:
    6
    Likes Received:
    0
    Good to know and I really appreciate your time to explain. Now I've got a whole bunch of categories created from my testing. Would you happen to know how to delete them so that I can have a cleaner config?
     
  11. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Unfortunately there's no way for users to delete those categories :( I would have to add an option in the app to do it. What you need to do if you really want to is to uninstall the app and then re-install it. Sorry! Wish Google hadn't made this whole category system so cumbersome...
     

Share This Page