Huawei EMUI 8 Oreo - Notification Channel - Tone
Asked Answered
I

2

9

Some users are reporting on Huawei EMUI 8.0 Oreo that the Notification Channel does not have the option to change tone "Sound" / "Notification Tone" from the app!

As of the official docs the developer can't change the settings anymore.
So how can I add an option for Huawei phones to change the "Notification Tone" again?

And does anyone know why the hell Huawei removed this feature?
I don't find official docs from Huawei how we can now let the user change the notification tone.

Offical docs I am referring:
https://developer.android.com/reference/android/app/NotificationChannel.html

https://developer.android.com/reference/android/app/NotificationChannel.html#setSound(android.net.Uri, android.media.AudioAttributes)

Illyrian answered 26/12, 2017 at 19:30 Comment(0)
P
2

We ran into the same issue recently. It is not a nice solution, but WhatsApp is doing the same. Basically we show a ringtone selection inside our app and then delete and recreate the notification channel with a new channel id and the selected ringtone uri. You can copy most settings made to the channel to the new one except 'do not disturb'.

Like I said it is not a nice solution and I don't know what will happen if the channel is recreated a lot. But hopefully the ringtone is not changed too often.

Note: The notification settings screen displays the number of deleted channels, as a spam prevention mechanism.

Piacular answered 3/12, 2018 at 17:20 Comment(0)
B
1

Faced with same issue on chinese devices. Firstly, i have same solution like describe @Devenias. How it works in system: when you're defining a new channel, NotificationService save this channel in xml, after you changed it, it still contains in this xml. So on a new change of channel, NotificationService will check if it have a channel with a same name, and just retrieve it. So i make new channel with a new settings all the time, when user change vibration or ringtone in app. Also it works like a cache, just make unique channel name for pair<ringtone, vibration>. This solution is pretty hacky, since it works good on Honor's, Huawei's, Samsung's devices and Xiaomi Mi A1, but it have been crashing NotificationService with NullPointer in SystemUI on Xiaomi Mi Mix 2 (device make soft reboot, if SystemUI service crashed), so don't use this solution.

So nowadays a safe workaroud is to play sound and vibration manually.

Berry answered 24/12, 2018 at 12:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.