Android Question Notifications priority "LOW" is not working on Samsung Note10+

Åke Johansson Bravida

Member
Licensed User
Hello.

I have problem with my new device Samsung Note10+ I can't get the NB6 to send notifications without sound.
I use this code in older devices and they are running as I expexted.

B4X:
If alarm = True Then
            n.Initialize("default", Application.LabelName, "HIGH").SmallIcon(tools)
            n.Build("LARM !!!", "Temperaturen är HÖG!!!", "Tag", Me).Notify(8)
        Else
            n.Initialize("default", Application.LabelName, "LOW").SmallIcon(tools)
            n.Build("LARM !!!", "Temperaturen är HÖG!!!", "Tag", Me).Notify(8)
        End If

Is something changed in new devices?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
1. The issues you encounter are not related to the specific device. They are probably related to the OS version (which you haven't wrote).

2. Always try to avoid duplicating code. Duplicated code = unmaintainable code.
B4X:
Dim importance As String
If alarm Then importance = "HIGH" Else importance = "LOW"
 n.Initialize("default", Application.LabelName, Importance).SmallIcon(tools)
n.Build("LARM !!!", "Temperaturen är HÖG!!!", "Tag", Me).Notify(8)
In which way it doesn't work? Have you tried to open the top notification drawer?
 
Upvote 0

Åke Johansson Bravida

Member
Licensed User
The notification is ok but I dont want the sound when importance = LOW
I want to switch off the notification sound. I tryed your code but it is still the same. That is I got sound when importance = LOW and thats what i dont want only when importance = HIGH.
 
Upvote 0

kisoft

Well-Known Member
Licensed User
Longtime User
Hi
Remember that once you give the status it will be remembered in the system, uninstalling the application will not help. Rename the package and reinstall the application. Maybe you accidentally set the application to High and that's the reason.
 
Last edited:
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Remember that once you give the status it will be remembered in the system, uninstalling the application will not help. Rename the package and reinstall the application.
This is not exactly true.
1. It is enough to change the channel name.
2. The actual channel name created includes the importance level. So changing the importance level will change the actual channel name.

he notification is ok but I dont want the sound when importance = LOW
Change the channel name and set n.Sound = False.
 
Upvote 0
Top