Android Question NB6 notification without sound

Status
Not open for further replies.

Scantech

Well-Known Member
Licensed User
Longtime User
how do i disable the sound?

B4X:
    Dim smiley As Bitmap = LoadBitmapResize(File.DirAssets, "icon.png", 24dip, 24dip, False)

    Dim n As NB6
    n.Initialize("default", Application.LabelName, "DEFAULT").AutoCancel(True).SmallIcon(smiley)
    n.Build(Title, Body, "$534##", Search).Notify(4)
 

coslad

Well-Known Member
Licensed User
Longtime User
Maybe must be a mistake, my notification Always play sound if phone audio is on or vibrate if phone vibrate is on


B4X:
Notification1.Initialize2(Notification1.IMPORTANCE_LOW)
Notification1.Sound = False
Notification1.Vibrate = False
Notification1.Icon = "icon"
Notification1.SetInfo("Casa", "avvio", Main)
 
Service.StartForeground(1,Notification1)
ph.PartialLock

B4X:
Private Sub UpdateNotification
    Dim n As NB6
    Dim icon As String
    Dim content As String
    Dim  smiley As Bitmap
    
    
    
    If connected = True Then
        icon = "casa_conn.png"
        content = "Connesso" & (DateTime.Time(DateTime.Now))
    Else
        icon = "casa_disconn.png"
        content = "Tentativo connessione : " & (DateTime.Time(DateTime.Now))
    End If
    
    smiley = LoadBitmapResize(File.DirAssets, icon, 24dip, 24dip, False)
    
    n.Initialize("default", Application.LabelName, "LOW").AutoCancel(True).SmallIcon(smiley)
    n.Build("Casa",content ,"",Main).Notify(1)
    
End Sub


PS Android 8 , B4A 8 , Sdk 26
 
Upvote 0
Status
Not open for further replies.
Top