Android Question NB6 and Categories toggle on and off issue

Scantech

Well-Known Member
Licensed User
Longtime User
I send a notification with sound and vibration using NB6 at channel 2. When notification is sent, everything is working, sound and vibration is ok. When i go to Android Category Settings and toggle the on to off and back on. The message shows "with sound" to "no sound". Now, the notification can't make any sound and vibration? Why is that?

B4X:
Service.StartForeground(1, CreateNotification("..."))

Sub CreateNotification (Body As String) As Notification
    Dim notification As Notification
    notification.Initialize2(notification.IMPORTANCE_LOW)
    notification.Sound = False
    notification.Vibrate = False
    notification.Light = False
    notification.Icon = "icon"
    notification.SetInfo("Status", Body, Starter.WhatFormName)
    Return notification
End Sub
Sub BigText_Notification2(Body As String, Body2 As String)
    'the behavior will not be same if channels is changed or setdefaults
    Dim n As NB6
    n.Initialize(1, Application.LabelName, "LOW").SmallIcon(TripIcon2).AutoCancel(True)
    n.SetDefaults(False, False ,False)
    n.BigTextStyle("Status", "", Body2)
    n.Build("Status", Body, "tag2", Starter.WhatFormName).Notify(1)
End Sub
Sub BigText_Notification (Body As String)
    'the behavior will not be same if channels is changed or setdefaults
    Dim n As NB6
    n.Initialize(2, "Vehicle Maintenance", "DEFAULT").SmallIcon(TripIcon1).AutoCancel(True)
    n.SetDefaults(True, False ,True)
    n.BigTextStyle("Maintenance Service Schedule", "", Body)
    n.Build("Maintenance Service Schedule", "Alert", "tag", Maintenance).Notify(2)
End Sub

It shows i have 3 categories. I hope that is correct
 

Scantech

Well-Known Member
Licensed User
Longtime User
I have never knew you can change the Importance. Android 8 is new to me. Disregard the above post.
 
Upvote 0
Top