Hi All, i started using this class and it works great Thank you @Erel, however i'm having an issue where i receive two notifications when i send a notification, i'am using a service which builds the notification and displays it when ready, the problem is that if the app is active meaning opened, i only receive 1 notification and i see a number 1 badge on the app's icon, but if the app is closed i receive two notifications and i see a number 2 badge on the app's icon, i'm able to clear the notification that contains the message but the second notification stays and i can't seem to clear it or make it go away.
Here's my code.
B4X:
Sub BigText_Notification(title As String, message As String)
Dim n As NB6
n.Initialize("default", Application.LabelName, "HIGH").SmallIcon(icon)
Dim cs As CSBuilder
''n.BigPictureStyle(icon.Resize(256dip, 256dip, True), icon, title, message)
n.BigTextStyle(title, cs.Initialize.BackgroundColor(Colors.Green).Append("Message Summary").PopAll, message)
Dim cur1 As Cursor
cur1 = Common.SQL1.ExecQuery("SELECT * FROM registration")
cur1.Position = 0
'check if user is registered to a group, otherwise register to group by
'getting groupregistered flag in notification message.
Dim groupregistered As Int
Try
groupregistered = cur1.GetInt("groupregistered")
If groupregistered <> 0 Then
n.Build(title, "Read Content Below", "notification_alert", CustomMessages).Notify(1)
Else
n.Build(title, "Read Content Below", "notification_alert", Main).Notify(1)
End If
Catch
n.Build(title, "Read Content Below", "notification_alert", Main).Notify(1)
End Try
End Sub
What's interesting is that the first notification has the icon i assigned in my code and the second notification has a different icon, if you guys notice carefully the top notification has an icon which has the word Titans on the logo and the second notifications has the icon without the word Titans on it, i have both of these icons in my Obj/Res/Drawable folder but am only assigning one of them, i looked in my code and there is no other place where i'm calling for another notification.
Thanks All,
Walter
Last edited: