Alexander Stolte Expert Licensed User Longtime User Jan 2, 2019 #1 Hello, how can i group notifications with NB6? For example WhatsApp:
Solution Alexander Stolte Apr 26, 2019 I found a solution here: "Create Group Notifications" thanks @wes58
DonManfred Expert Licensed User Longtime User Jan 3, 2019 #2 - https://developer.android.com/training/notify-user/group - https://stackoverflow.com/questions/33040737/how-to-group-android-notifications-like-whatsapp Last edited: Jan 3, 2019 Upvote 0
- https://developer.android.com/training/notify-user/group - https://stackoverflow.com/questions/33040737/how-to-group-android-notifications-like-whatsapp
Alexander Stolte Expert Licensed User Longtime User Jan 3, 2019 #3 i added this 2 subs to the nb6: Code: Copy Public Sub SetGroup (groupname As String) As NB6 ' If IsBuilder Then NotificationBuilder.RunMethod("setGroup", Array(groupname)) 'End If Return Me End Sub Public Sub SetGroupSummary (summary As Boolean) As NB6 ' If IsBuilder Then NotificationBuilder.RunMethod("setGroupSummary", Array(summary)) ' End If Return Me End Sub and follow the tutorial on the android page: Code: Copy Dim n As NB6 n.Initialize("default", Application.LabelName, "DEFAULT").AutoCancel(True).SmallIcon(smiley) n.SetGroup("b4a.example3nb6.TEST_GROUP") n.SetGroupSummary(True) n.Build("Title", "Content", "tag1", Me).Notify(Rnd(1,1000)) but the notification is still not grouped Upvote 0
i added this 2 subs to the nb6: Code: Copy Public Sub SetGroup (groupname As String) As NB6 ' If IsBuilder Then NotificationBuilder.RunMethod("setGroup", Array(groupname)) 'End If Return Me End Sub Public Sub SetGroupSummary (summary As Boolean) As NB6 ' If IsBuilder Then NotificationBuilder.RunMethod("setGroupSummary", Array(summary)) ' End If Return Me End Sub and follow the tutorial on the android page: Code: Copy Dim n As NB6 n.Initialize("default", Application.LabelName, "DEFAULT").AutoCancel(True).SmallIcon(smiley) n.SetGroup("b4a.example3nb6.TEST_GROUP") n.SetGroupSummary(True) n.Build("Title", "Content", "tag1", Me).Notify(Rnd(1,1000)) but the notification is still not grouped
DonManfred Expert Licensed User Longtime User Jan 3, 2019 #4 Please see this answer from SO Right. I find the API confusing: NotificationCompatBuilder.setGroup() method comes from the Wearable API. Its purpose is to manage notification groups on the wearable - though it also affects the phone. But most people are looking for the Gmail-Whastapp-like groups on the phone. Answer is : you have to do it yourself using notificationIDs to update your notifications. And you have to save your data between each notifications, to be able to compute the "summary" notification - which is, again, up to you to build and to send with the same ID to replace the previous "non-summary" notification. – John May 4 '16 at 16:22 Click to expand... Upvote 0
Please see this answer from SO Right. I find the API confusing: NotificationCompatBuilder.setGroup() method comes from the Wearable API. Its purpose is to manage notification groups on the wearable - though it also affects the phone. But most people are looking for the Gmail-Whastapp-like groups on the phone. Answer is : you have to do it yourself using notificationIDs to update your notifications. And you have to save your data between each notifications, to be able to compute the "summary" notification - which is, again, up to you to build and to send with the same ID to replace the previous "non-summary" notification. – John May 4 '16 at 16:22 Click to expand...
Alexander Stolte Expert Licensed User Longtime User Apr 26, 2019 #5 I found a solution here: "Create Group Notifications" thanks @wes58 Upvote 0 Solution