I have a service that create a notification and play a custom sound.
work fine, but i enable the notification clear, doesn't play the sound.
i change only
Notif.OnGoingEvent = True -> False
Thanks
work fine, but i enable the notification clear, doesn't play the sound.
i change only
Notif.OnGoingEvent = True -> False
Thanks
B4X:
Sub Process_Globals
Dim Notif As Notification
Dim NotifSound As SoundPool
Dim NotifID As Int
End Sub
Sub Service_Create
Notif.Initialize
Notif.Icon = "notification"
Notif.Sound = False
Notif.Vibrate = False
Notif.Light = False
' Notif.OnGoingEvent = True
Notif.OnGoingEvent = False
Notif.AutoCancel = False
'Notif.Number = Counter
NotifSound.Initialize(2)
NotifID = NotifSound.Load(File.DirAssets, "notification.ogg")
End Sub
Sub Service_Start (StartingIntent As Intent)
Notif.SetInfo2(Title, Body, "IDNews", Calendar)
Notif.Notify(1)
NotifSound.Play(NotifID, 1, 1, 1, 0, 1)
end sub