Sub Process_Globals
Dim n1 As Notification
End Sub
.
.
.
.
.
Private Sub CreateNotification(Title As String, Content As String, Icon As String, TargetActivity As Object, Sound As Boolean, Vibrate As Boolean) As Notification
Dim p As Phone
If p.SdkVersion >= 26 Then
Dim nb As NotificationBuilder
Dim Channel As NotificationChannelBuilder 'New object
Dim ChannelID As String = "ies_atlas_hello"
Dim ChannelName As String = "Atlas Hello"
'Build a Channel
If Channel.ChannelsSupported Then
Channel.Initialize(ChannelID, ChannelName, Channel.IMPORTANCE_LOW)
Channel.Build
End If
nb.Initialize(ChannelID)
nb.OnGoingEvent = True
nb.DefaultSound = Sound
nb.DefaultVibrate = Vibrate
nb.DefaultLight = False
nb.ContentTitle = Title
nb.ContentText = Content
nb.setActivity(TargetActivity)
nb.SmallIcon = Icon
' //set the return object for the notification object (n1) in this service
n1 = nb.GetNotification
Else
n1.Initialize
n1.Light = False
n1.Vibrate = False
n1.Sound = False
n1.OnGoingEvent = True
n1.Icon = Icon
n1.SetInfo(Title, Content, TargetActivity)
End If
Return n1
End Sub