Android Question NB6 Custom sound and HIHT priority

RobertoS

Member
Licensed User
Longtime User
Hi,
I have a problem with the NB6 notification library. I'd like to make a notification with high priority and a custom sound, goes I see it can't be done.
The setCustom function doesn't set the custom sound to false if we are in isChannel = true mode, how can I do to disable the defautl sound and use my own?

B4X:
Public Sub SetDefaults (Sound As Boolean, Light As Boolean, Vibrate As Boolean) As NB6
    If IsOld Then
        OldNotification.Sound = Sound
        OldNotification.Light = Light
        OldNotification.Vibrate = Vibrate
    Else
        If IsChannel Then           
            Channel.RunMethod("enableLights", Array(Light))
            Channel.RunMethod("enableVibration", Array(Vibrate))
        Else
            Dim CurrentDefaults As Int
            If Sound Then CurrentDefaults = 1
            If Vibrate Then CurrentDefaults = Bit.Or(CurrentDefaults, 2)
            If Light Then CurrentDefaults = Bit.Or(CurrentDefaults, 4)
            NotificationBuilder.RunMethod("setDefaults", Array(CurrentDefaults))
        End If
    End If
    Return Me
End Sub

I need the high priotity notification to have the badge on the screen when using the app.

Thank you very much

Roberto Sitzia
 
Top